DocsTemplates & site structure
Display conditions
Rules for where templates apply and when elements, popups and menu items show: by page, visitor, data, date — and, for popups and interactions, what the visitor’s browser knows.
How conditions work#
- Include groups say where something applies. A group’s rules must all match; any group may match.
- Exclude groups say where it doesn’t, even when an include group matches.
- Any rule can be negated (“is not”).
The same conditions are used for templates, elements (Advanced → Display conditions), popups, menu items and interactions, and the builder describes them in plain words: “All Posts in News”, “Entire site, except anything in Landing Pages”.
Every rule#
33 kinds of rule:
Where: the page being viewed
| Rule | Matches |
|---|---|
| Entire site | |
| Front page | |
| Blog posts page | |
| Single post of type | Posts, pages or any custom post type. Leave empty for every single view. |
| Specific posts or pages | |
| Any archive | Blog index, categories, tags, taxonomies, authors, dates and post type archives. |
| Post type archive | |
| Taxonomy archive | Category, tag or custom taxonomy archives. Leave empty for all of them. |
| In category / term | Posts that have one of these terms, and those terms' archives. |
| By author | |
| Author archive | |
| Date archive | |
| Search results | |
| 404 page | |
| Address (URL) | The page's address (path and query string) is, contains or doesn't contain something, like /pricing or utm_source=. |
| Uses a template | Pages shown with one of these Native AI templates (a header, a single post template…). |
| WooCommerce pages | Shop, products, cart, checkout and account pages (when WooCommerce is active). |
Who: the visitor
| Rule | Matches |
|---|---|
| Visitor is logged in | |
| Visitor has role | |
| Device | Phones and tablets, or computers, told apart on the server by the browser's user agent. For exact screen widths use Screen width (interactions, JavaScript and CSS). |
Data and dates
| Rule | Matches |
|---|---|
| Dynamic data | Compare any dynamic data token, like {custom_field:price} or {url_param:ref}. |
| Date and time | Between two dates (site time). Pages served from a cache may lag. |
Form fields (in form logic)
| Rule | Matches |
|---|---|
| Form field | What the visitor entered or picked in a field of the same form (form logic and form actions only). |
Checked in the visitor’s browser (popups and interactions)
| Rule | Matches |
|---|---|
| Screen width | Breakpoints, or a width range in px. Checked in the browser each time the interaction runs. |
| Element has class | An element (this one by default) has a class, checked when the interaction runs. |
| Element is in state | An element (this one by default) is in an interaction state such as open or active. |
| URL parameter | A parameter in the page’s address, like ?utm_source=newsletter. Checked in the browser. |
| Cookie | A cookie the browser has (or doesn’t have), and its value. |
| Came from | The address the visitor came from (the referrer), like google. or a partner’s site. |
| New or returning visitor | Whether this is the visitor’s first visit, remembered in their browser only. |
| Pages viewed this visit | How many pages the visitor has opened in this visit (including this one). |
| Earlier popup | What the visitor did with another popup: saw it, closed it, clicked in it, sent its form or converted. |
| Remembered value | A value an interaction remembered in the visitor’s browser (the Remember action). |
Where each kind of rule works#
- Location, visitor and data rules work everywhere, and WordPress checks them before the page is sent.
- Form field rules are for form logic. See Conditional logic and multi-step forms.
- Browser rules — screen width, URL parameter, cookie, where the visitor came from, new or returning, pages viewed, an earlier popup, a remembered value, an element’s class or state — are checked in the visitor’s browser, so they work in popups and interactions, not for templates.
Elements with conditions#
An element whose conditions don’t match is left out of the page. The canvas always shows it so you can edit it, and Layers marks it. Inside a Query Loop, data rules see each item’s own data. Settings → Advanced → Preview display conditions on the canvas (experimental) fades elements a logged-out visitor wouldn’t see.
Related articles
Still have a question? Email us at support.