Docs

Template conditions

Choose where each template appears, with include and exclude rules.

On this page

Display conditions tell Urmi where a template appears: a header on the entire site, a single post layout on the posts of one category, a popup everywhere except the Contact page. Headers, footers, single and archive layouts, search results, the 404 page and popups all have conditions. Saved sections, loop items and mega menus do not: they appear where you place them.

The Display conditions drawer of a popup: Include Entire site, and Exclude Posts, pages & custom types limited to the Contact page
Include the entire site, exclude one page.

Edit conditions

You can open the conditions from three places:

  • In the Theme Builder, click the Where it appears cell of a template, or choose Display conditions… in its ⋯ menu.
  • In the editor, open the template's settings tab (Header, Footer, Popup or Template) and click Edit conditions (or Add conditions) under Display conditions.
  • In the editor, open the arrow next to Publish and choose Display conditions….
  1. Add a condition

    Click Add condition. The first one includes the Entire site; later ones start as exclusions.

  2. Include or exclude

    Choose Include to show the template there, or Exclude to keep it away.

  3. Choose where

    Pick a rule, then narrow it down with the fields that appear: a post type, a taxonomy, specific posts, pages, terms or authors. Leave a field empty to mean "all".

  4. Save

    Click Save conditions.

Conditions only take effect once the template is published. A published template without conditions is Not shown anywhere.

Rules

General
RuleWhere the template appears
Entire siteEvery page, post, archive, search result and the 404 page.
Singular
RuleWhere the template appears
Posts, pages & custom typesSingle posts, pages or custom post type items. Choose a post type (or Any post type), and optionally pick specific items.
Front pageYour home page.
Posts in a category or termPosts that have a category, tag or other term. Choose the taxonomy, and optionally specific terms.
Child pages ofPages below a parent page (at any depth). Optionally pick the parent pages.
Posts by authorPosts written by some authors.
Archives
RuleWhere the template appears
ArchivesAll archives, the archive of a post type (for example Posts), or the archives of a taxonomy (for example Categories), optionally for specific terms.
Blog (posts page)The page that lists your latest posts.
Author archivesAuthor pages, for all or some authors.
Date archivesYear, month and day archives.
Search resultsThe search results page.
Other
RuleWhere the template appears
404 pageThe page shown for broken links.

When several templates match

On any page, only one template of each type is used, for example one header. Urmi picks it like this:

  1. A template with a matching Exclude condition is out on that page.
  2. Among the rest, the template with the most specific matching include wins.
  3. When two templates are equally specific, the one edited most recently wins.
  4. When nothing matches, your theme's own header, footer or layout is used.

From most to least specific, the rules rank roughly like this:

  1. Front page and 404 page
  2. Blog (posts page)
  3. Specific posts or pages picked in Posts, pages & custom types
  4. Specific authors in Author archives, specific terms in Archives
  5. Search results
  6. Child pages of, then Posts in a category or term
  7. Posts by author, Author archives, Date archives, a taxonomy's archives
  8. A post type's archive, or all items of one post type
  9. Posts, pages & custom types with any post type, All archives
  10. Entire site

So a header for the Contact page beats the site-wide header on that page, and a single post layout for the "Case studies" category beats the one for all posts.

Examples

GoalConditions
One header everywhereInclude Entire site
A different header on landing pagesSecond header: include Posts, pages & custom types → Pages → your landing pages
No footer on the Contact pageFooter: include Entire site, exclude Posts, pages & custom types → Pages → Contact
A layout for case study postsSingle post template: include Posts in a category or term → Categories → Case studies
A popup only on the blogInclude Blog (posts page) and Posts, pages & custom types → Posts

Popups use the same rules to decide on which pages they are available. Their triggers and targeting then decide when they open and for whom. To show or hide a single element instead of a whole template, use element display conditions.