Skip to main content
Documentation/Templating/Location, Conditions & Priority
Templating

Location, Conditions & Priority

Every template, header and footer answers the same question: when does this render?
Oxygen answers it with three settings — a Location that picks the broad target,
optional Conditions that narrow it, and a Priority that decides who wins when
more than one candidate matches. The three work identically for all three template
types, so they're documented once, here.

You set them in the Add template dialog when you create a template, and can reopen
them any time from Settings on the template's row.

A template's settings dialog showing Location, Conditions and Priority together

Location

The Location dropdown sets the broad target, and for many templates it's the whole
answer — a template at Posts with nothing else set renders for every blog post.

Group Locations
Everywhere Every page of the site.
Single All Singles (any single post, page or custom post type item), one specific post type (Posts, Pages, Media, and every public custom post type you've registered), or the Front Page. See Single Templates.
Archive All Archives, Taxonomy Archive, Date Archive, Author Archive, Post Type Archive, or Post Archives — the blog posts index. See Archive Templates.
Other 404 – Not Found Error and Search Results. See 404 Templates and Search Templates.
The Location dropdown open in the Add template dialog, showing the Everywhere, Single, Archive and Other groups

Conditions

Location picks the broad target; conditions narrow it further. A Posts template with the
condition "User Logged In Status is logged out" applies only to posts viewed by
logged-out visitors.

Each condition row is a condition, an operand, and a value — for example Post Status
/ is / Published. Which conditions are offered depends on the Location you chose;
the full catalogue is in
Conditions Reference.

A condition row — condition, operand and value — with the AND button on the row and Add Condition beneath it

AND conditions

AND, on a condition row, adds another condition to the same group. Every condition in
a group must be true for that group to match.

Two conditions joined by AND in one group, both of which must be true

OR conditions

Add Condition, below the rows, starts a new group, joined to the previous ones with an
OR divider. The template applies if any one group matches.

Two condition groups separated by the OR divider, either of which can match

The same condition system also powers per-element visibility — see
Element Display Conditions.

Priority

Only one template renders for any request: the one with the highest Priority among
those whose Location matches and whose Conditions pass.

To force an override, raise the number — a "Members" Posts template at priority 30 beats
the regular Posts template at 20 whenever its conditions match. If two matching templates
have the same priority, the one that has conditions wins.

The Priority field in a template's settings, set to 30 to beat another template at 20

Default priorities

Oxygen pre-fills a default that encodes "specific beats general", so a Posts template
naturally overrides an All Singles template without you touching anything:

Location Default priority
Everywhere 1
All Singles, All Archives, Post Archives 10
A specific post type, Front Page, or a specific archive type 20
404 – Not Found Error, Search Results 1