A template controls the layout in which the content of pages and posts is presented. This guide will show you how to edit templates to customize page and post layouts, including header and footer elements.
In this guide
Your theme includes a set of templates that you can edit. To edit a template included with your theme, follow these steps:
- Visit your site’s dashboard.
- Navigate to Appearance → Editor.
- Click on the “Templates” option in the left sidebar.
- On the main page area, click on a template preview thumbnail to open the template in the editor.
- You can also click on the three dots at the bottom right corner of each template and select the “Edit” option.
You can also edit templates while editing an individual page or post with the following steps:
- While editing a page or post, open settings on the right sidebar.
- Click on the template name (1) to open the template options.
- Select the “Edit template” option (2).
- Make your changes, which will apply to all pages that use that template.
In the template editing screen, you will find the name of the template you’re editing (1), and under Settings, you’ll find “Template”(2):
To view a list of all the blocks in your template, click on the “List View” icon at the top left of the screen (the icon looks like three horizontal lines.) List View is useful for seeing the overall structure of your template before you start editing specific sections. You can then click on any block in the List View to move, remove, or change that block’s settings or content.
While editing a template, click on any block to adjust the content or change the block settings. Some of the actions you can take here include:
- Edit the header elements such as the Site Title block, Site Tagline block, and Site Logo block. Visit Customize Your Header to learn more.
- Add or edit your menu using the Navigation block.
- Add a sidebar using columns.
- Control the appearance of your posts.
- Hide page or post titles.
- Edit the appearance of your footer.
Your template likely also includes a Content block. This default block is a placeholder that, on the actual page, will show the specific content you have added to that page. If your page is not displaying the expected content, make sure to add the Content block to your template.
The possibilities are endless! Learn more about using the WordPress Editor here.
When you’re finished making edits, you can save your changes by clicking the “Save” button at the top right.
The affected templates and template parts will be shown here. Review the changes, and click the “Save” button again to save your changes.
If you change your mind after making changes to your template, you can restore your template to a previous version.
To restore a template revision from the Site Editor:
- In the Settings sidebar on the right, locate the Template section and click on the Revisions panel.
- You will be taken to the Compare Revisions page, where you will still see the history of template revisions with a slider to load earlier ones.
- Click on the slider to browse through previous revisions.
- Once you browse to a revision to revert, click the “Restore This Revision” button to load it in the editor.
- Click the button labeled “Save” to restore the template revision.