What is a full site editing template?

Level: ,

There are different types of templates in WordPress:

  • Templates for your home page, blog, archives, and 404 pages.
  • Custom page templates are used with pages, posts and custom post types.

Custom page templates let you select different designs for different content. These templates are optional, and you decide if you want to use or create a custom template.
While only developers can create traditional page templates with code, anyone (with the correct permission) can create a block template using a full site editing theme.

You create full site editing templates using blocks. -If you are already familiar with block patterns, think of a template like an extra-large pattern, where the post content is one block.

Most importantly, these templates are structural. They are used to change the webpage layout and position blocks and not for adding content. This is because the custom templates are tied to your theme, not your website. If you switch themes, the content in your custom block templates is stored in the database but unavailable unless you switch the theme back.

Estimated reading time: 6 minutes

Last updated

Limitations with templates today

-Let’s look at some of the problems that full site editing is trying to solve:

  • Only theme developers can create and edit traditional templates
    • If you have a classic theme with a sidebar but would like to remove the sidebar from one page, you need to know the code or the CSS to hide the sidebar.
  • You can not preview templates before you select them
    • You select a traditional template by opening a post or page and selecting a template from the Page Attributes Template section. All you have to go by is the name:
The page attributes section in the block editor where the Template option has  an expanded select list. The default template is selected in the list.
  • You can not see what the template looks like when adding and editing content
    • You can only see the full page by viewing the website on the front, not in the editor.

Improvements to templates with full site editing

With block themes, users can:

  • Create and edit their own custom templates.
  • Choose what part of a page to see when editing: Content only, full page, header or footer.
  • Split larger templates into template parts that can be used in multiple templates.
  • Preview templates in the Site Editor.

Themes can now include editable, non-editable, and even locked templates where users can only edit parts of the content.

  • A traditional page template that you can not edit without code. – Existing templates will not change. Posts and pages that use these templates will not break.
  • A full site editing block template that you can edit.

There are two ways to edit block templates without code:

The template editor is a part of the block editor since WordPress 5.8. This is where users can create, edit and delete custom page templates that are assigned to posts, pages, and custom post types. This feature is only available if the theme developer has enabled it.

The Site Editor. An advanced template editor was added in WordPress 5.9. This is where you edit your blog, archive pages, 404 page, etc., and where you can preview all templates.
This feature is only available in block themes.

The template editor

The template editing mode is part of the block editor and is built for viewing and editing single pages and posts (and custom post types). It does not require a block theme to be active: It can also be used with classic themes if the theme developer has added support for it.

Once you have opened a page or post in the block editor, you access the template editor from the Summary panel in the document sidebar:

The template editor can be reached by selecting the template name in the Summary panel.

Creating your own page template

Clicking on the template name and then clicking on the “Add template” icon will create a new template for your current page:

Clicking on the template name opens a small modal with an option to add a new template.

The template editor is very similar to the block editor. The difference is that you are viewing the full web page; both the layout and your page content. Here is what this page looks like in the template editing mode using Gutenberg 10.7.1:

-The dark grey border is part of the editor and is added so we can easily see the difference between the block editor and template editor. Basically, it helps us see where we are.

At the top, you can see the header area with the site title block, navigation menus, and search. Below that is the post content block. This is the same content that is in the block editor.
You can save changes to both the content and the template in this view.
When you select a single block, the block has the same options as in the block editor.
To return to the editor, you can select the back button.

The Site Editor

The Site Editor is a new interface in WordPress 5.9 that requires a block theme to be active on the website. You access the Site Editor from the WordPress admin area under Appearance > Editor. Here you can preview, edit and restore templates and template parts. This is where you will customize your blog, archives, 404 page, and search result templates.

If you followed along with the lesson on how to switch to full site editing, this is the editor that we used to change the navigation menu and footer sections.

The Site Editor consists of three main parts:

  • A navigation sidebar on the left, which takes you to a list of all your templates and template parts
  • The content area where you add and manage blocks
  • The Styles sidebar is where you select colors, fonts, and more for the website and blocks.

Both sidebars are collapsed by default.

The Site Editor with both the navigation sidebar and the styles sidebar open.

The Site Editor has a list of all templates and template parts: Templates that you have created, and templates added by theme or plugins:

The Site Editor template list.