Templates and Template Parts
Short url: https://ewp.guide/go/templates-and-template-parts
Whilst this guide was never intended to be a guide for developers, you may find it helpful to have a basic understanding of the different Templates and Template Parts that make up a Theme. For most people, the theme you’re using will have all the templates that you’ll need. If you want to change the way some part of your site looks, it will just be a matter of editing one of the existing templates.
For some people though, you may want to completely customise your site, either by editing existing templates, or creating new templates. This is where an understanding of templates will come in handy, along with an understanding of the WordPress Template Hierarchy.
The WordPress Template Hierarchy helps WordPress determine which template to use when displaying your content in the browser. As an example, WordPress will typically use a different template to show your standard Page content, compared to what it uses to show your Blog archive page (i.e. the page that shows a list of your latest blog Posts). The Theme Handbook over on the official WordPress.org website explains in further detail, how this Template Hierarchy works, along with providing a visual overview of when each template is used.
To edit a particular template using the Full Site Editor, or to create a new template, click the Templates menu in the left-hand navigation. You’ll be shown a list of the templates contained within your current theme. Clicking on a Template name will show you a preview of that particular template. You can then click on the Template preview image to actually edit that Template.
There’s also an option to Manage all templates. Clicking this option will again show you a complete list of the templates contained within your current theme, along with a short description of what the template is used for. Clicking on a template name will show you a preview of that Template, and then clicking on that preview image will allow you to actually edit that Template.
If you’d like to create a new template that doesn’t currently exist within your theme, click the Add New button at the top-right of the screen and then click on the template that you wish to add to your theme. You can also create a custom template with the Custom template option.