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

RuleMatches
Entire site
Front page
Blog posts page
Single post of typePosts, pages or any custom post type. Leave empty for every single view.
Specific posts or pages
Any archiveBlog index, categories, tags, taxonomies, authors, dates and post type archives.
Post type archive
Taxonomy archiveCategory, tag or custom taxonomy archives. Leave empty for all of them.
In category / termPosts 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 templatePages shown with one of these Native AI templates (a header, a single post template…).
WooCommerce pagesShop, products, cart, checkout and account pages (when WooCommerce is active).

Who: the visitor

RuleMatches
Visitor is logged in
Visitor has role
DevicePhones 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

RuleMatches
Dynamic dataCompare any dynamic data token, like {custom_field:price} or {url_param:ref}.
Date and timeBetween two dates (site time). Pages served from a cache may lag.

Form fields (in form logic)

RuleMatches
Form fieldWhat 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)

RuleMatches
Screen widthBreakpoints, or a width range in px. Checked in the browser each time the interaction runs.
Element has classAn element (this one by default) has a class, checked when the interaction runs.
Element is in stateAn element (this one by default) is in an interaction state such as open or active.
URL parameterA parameter in the page’s address, like ?utm_source=newsletter. Checked in the browser.
CookieA cookie the browser has (or doesn’t have), and its value.
Came fromThe address the visitor came from (the referrer), like google. or a partner’s site.
New or returning visitorWhether this is the visitor’s first visit, remembered in their browser only.
Pages viewed this visitHow many pages the visitor has opened in this visit (including this one).
Earlier popupWhat the visitor did with another popup: saw it, closed it, clicked in it, sent its form or converted.
Remembered valueA 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.