Templates

This document explains how templates control the layout of your pages and posts. It covers manual and automatic assignment, template types, conditions, and template order.

Mosaic template inside a Master layout, where each section is clearly hihglighted.

A template controls how a page or a group of pages looks: its structure, layout, and design. The content itself stays in WordPress; the template decides how it’s displayed. Each template has a type that decides where it can be used, such as the homepage, the blog archive, or a single post. It can also have conditions, for example to show it only to logged-in visitors.

Templates belong to the theme they were created in, because they’re built from that theme’s variables and classes. See What belongs to a theme.

Template ↔ Master

Every template sits inside a Master, the shared layout around it, such as your header and footer. A template can’t exist without one. Because many templates can share the same Master, these shared parts look the same on every page. In the editor, the template’s own area is highlighted in blue.

Assignment to pages and posts

A template is used either on the pages you pick (manual assignment) or on every page of its type (automatic assignment). You can use both on the same site.

Manual assignment

A manually assigned template is used only on the page, post, or custom post you assign it to, so you can design that page freely without affecting the rest of your site. This is the most common choice for one-off pages, such as your Home or About page, where each page gets its own template. You can assign it when you create the page:

You can also assign it later from the WordPress Pages or Posts screens:

Mosaic template assignment screen showing how a custom template can be manually assigned.

Automatic assignment

An automatic template is used on every page that matches its template type. For example, one Single post template can display all your blog posts, each filled with its own dynamic content, and new posts get the same design automatically. When several automatic templates match, their conditions and order decide which one is used.

Template type

The template type decides which pages an automatic template is used on. It also sets which Variables you can use in the editor: a Single post template, for example, gives you post variables like Title and Excerpt.

These are the available template types:

Post

  • Single post: displays a single blog post.
  • Post archive: your blog’s posts page, listing your recent posts. If your homepage shows your latest posts (Settings → Reading in WordPress), it’s called Homepage – Post archive and is used for your homepage.
  • Category archive, Tag archive, Format archive: list the posts of one category, tag, or post format, for example when a visitor clicks a category link.
  • Author archive: lists the posts of one author, like an author profile page.

Page

  • Single page: displays a single page. It works like Single post, but for pages.

Media

  • Single media: displays the page of a single media item, such as an image or a video, with its details.

Other

  • Search result: lists the posts and pages that match a visitor’s search. To build a search bar and its results page step by step, see Building a search bar.
  • 404 Not found: shown when a visitor opens a page that doesn’t exist. It’s a good place for a friendly message and a link back to your homepage.

Fallback

Fallback templates cover everything that no more specific template matches.

  • Homepage fallback: your homepage, when it’s a static page without its own template. If your homepage shows your latest posts, it’s marked Inactive, because Homepage – Post archive comes first.
  • Single fallback: any single post or page that has no more specific template.
  • Archive fallback: any archive, such as a category or tag archive, that has no more specific template.
  • Empty: the last resort, used when nothing else matches.

Managing templates

Open Mosaic and select Templates in the Left menu. Here you see all your templates: you can create new ones, change the settings of existing ones, or click a template to open it in the Editing interface.

For more options, open the three-dot Context menu on a template:

Context menu for a template in Mosaic showing management actions like edit, duplicate, assign, or delete
  • Settings: change the template’s name, assignment, type, and Master, and add conditions. See Template settings.
  • Duplicate: creates a copy of the template, a handy starting point for a similar one.
  • Generate thumbnail: creates a small preview image of the template, so you can tell templates apart without opening them. Helpful when you have many, or similarly named, templates.
  • Delete: deletes the template permanently. This can’t be undone, so use it with care.

Template settings

In the settings, you can rename the template, set Assign to Auto or Manual, and choose the Template type and the Master. The Conditions tab only appears when Assign is Auto.

Use conditions to control when an automatic template is used, for example only for logged-out visitors, or only for posts in a certain category. See Template conditions.

Post & Page assign

Edit with Mosaic

You’ll find the Edit with Mosaic button and link in several places in WordPress, for example in the Pages list and in the block editor. What it does depends on the page:

  • No template yet: asks you to choose a template for the page first (see Template assignment).
  • Has a template: opens the template in the editor.
Edit with Mosaic button shown in the WordPress interface, available in the pages list and Gutenberg editor for quick access

Template assignment

When a page has no template yet, choose how it should get one:

Template assignment interface in Mosaic allowing users to select the desired template type for a specific page
New template

Creates a new template right from the page. You choose its Master, and Mosaic manually assigns the template to this page.

Existing templates

Assigns one of your existing templates to this page. This is a manual assignment too.

Auto template

The page uses the automatic template of its type. For example, if you have an automatic Service page template, every new service page gets the same design and structure. Conditions and template order let you fine-tune which automatic template a page gets.

If there’s no automatic template for this page type yet, Mosaic creates one for you.

Warning message in Mosaic notifying that a missing auto-assigned single-page template will be created automatically

Change template

If a page already has a template, it opens in the Editor with that template. To switch to a different one, use the Change template button, or reassign it in the block editor’s right sidebar. Both start the same flow as Edit with Mosaic.

Mosaic Editor showing a page with an assigned template and the Change template button.

Homepage

Which page is your homepage is set in WordPress, under Settings → Reading → Your homepage displays. If it shows your latest posts, the Homepage – Post archive template is used. If it shows a static page, that page’s own template is used, or, if it has none, the Homepage fallback template.

Prioritize templates

When several automatic templates have the same type, Mosaic goes through them from top to bottom and uses the first one whose conditions match. A template without conditions always matches, so put templates with conditions above it. Drag and drop templates to change their order.

Templates list in Mosaic with highlighted order

For example, say you have two automatic Single post templates, and one of them should only be used for posts in a specific category. If that one sits below the template without conditions, it’s never checked, because the other one always matches first. Move the template with the condition to the top.

Template conditions

Conditions decide when an automatic template is used, for example only for logged-out visitors, or only for posts in a certain category. Set them on the Conditions tab of the template settings.

The Conditions tab only appears when Assign is Auto. A manual template always shows on the pages it’s assigned to. If you switch a template to Manual, its conditions are kept and work again when you switch back to Auto. To show parts of a manual template only to some visitors, use conditional visibility on its elements.

You can build rules from things like the visitor’s logged-in state, query parameters, or categories:

Notice

Order matters. A template with conditions only gets checked if it’s above the templates without conditions. For example, a members-only Homepage template has to be above your regular Homepage template. See Prioritize templates.

Last updated: October 29, 2026

Still have more questions? Let us help!

Your cookie preferences

We use cookies to improve your experience, analyze traffic, and personalize content. By clicking "Accept all" you agree to storing them on your device. Read our privacy policy.