Site EditorIntermediate

WordPress template parts: headers, footers and shared structure

Understand WordPress template parts, find the part a page uses, and edit or duplicate shared headers and footers without changing unrelated templates.

Documentation checked against WordPress 7.1

A template part groups blocks that form a recurring piece of site structure. A header or footer is the usual example. Several templates can use the same part.

Follow the structure from the page

A page's content sits inside a template. That template can include a Header part, the page's Post Content block and a Footer part. Editing the page content changes that page. Editing the shared Header part changes every template that uses the same part.

A theme can contain several headers or footers. The existence of a part named Header does not prove that every page uses it. Inspect the template used by the view you want to change.

Find and edit a part

With a block theme active, open Appearance → Editor → Patterns and find the template parts. Open the relevant part and use List View to inspect its inner blocks. Make a small change, select Save and review the affected items.

You can also select a Template Part block while editing a template and use its Edit original control to focus on the shared structure. Check the title of the part before making changes.

After saving, view the homepage, a single post and an archive. If a view still uses the previous layout, inspect its template rather than changing unrelated parts at random.

Create a separate variation

Suppose you need a quieter header on article pages. Duplicate the current header in the Patterns area, give the duplicate a descriptive name, and edit it. In the appropriate article template, choose or insert the duplicate part in place of the original.

Keep the homepage template connected to the original header. Preview both page types before saving. A duplicate does not affect the original until you change which templates use it.

Use names based on function, such as Header for articles, rather than Header 2. Future editing is easier when the purpose is visible.

Distinguish parts from patterns

A normal pattern supplies a layout you insert into content. A synced pattern shares content across occurrences. A template part shares structural areas between templates. A footer can be assembled from a pattern and then saved as a template part; the pattern itself is not automatically a footer for your whole site.

Classic themes do not provide the full Site Editor. Some themes support selected template-editing features, but classic header.php and footer.php files are a different mechanism. Follow the theme's documented approach.

Saved edits and theme files

Editor changes can override the theme's supplied part without changing its files. Theme updates therefore do not necessarily replace your saved version. That also means an updated theme file may not appear while a user customization takes precedence.

Export or back up customizations before resetting anything. A reset can remove edits; it is not a general-purpose fix for a broken site. If you maintain file-based parts in a child theme, account for the editor's saved overrides during diagnosis.

Sources & verification

Sources checked September 16, 2026. Documented behavior is distinct from hands-on testing.