Conditions in Oxygen allow you to create dynamic user experiences. With conditions, you can show personalized messages to logged-in users, display content based on a post’s taxonomy, or completely change templates based on a custom field. Conditions give you the power to craft engaging and adaptive designs, and can be applied to Headers, Footers, Templates, and Elements.
A summary of the conditions included in Oxygen and the operands is included below. You may also learn more about conditions from the following articles:
Default Conditions
Here are the default conditions included in Oxygen. Some conditions may only be available for templates when certain locations are set.
Singular
- Post – Select the Post(s) that will trigger the condition. Note: Separate conditions that perform the same functionality for Pages, Media, or other CPTs may be available.
- Post Parent – Select the Post Parent(s) to trigger the condition. Note: Separate conditions that perform the same functionality for Pages, Media, or other CPTs may be available.
- Has Taxonomy – Select the Taxonomy that triggers the condition when assigned to a Post.
- Post ID – Enter the specific ID of the Post to trigger the condition.
- Post Status – Select the Post Status(es) to trigger the condition.
- Comment Number – Enter the number of comments to trigger the condition.
- Author – Select the Author to define the condition.
- Featured Image – Determine if the Featured Image must be set or not for the condition.
- Post Type – Select the Post Type(s) that will trigger this condition. Note: Only available when Template Location is set to Single
Taxonomy
- Is Taxonomy – Determines the desired taxonomies and/or terms needed for the condition. Note: Only available when Template Location is set to All Archives, Specific Product Archive, or Taxonomy Archive.
Archive
- Author – Select the Author(s) to trigger the condition. Note: Only available when Template Location is set to Everywhere or is an Archive.
- Post Type – Select the Post Type(s) necessary for the condition. Note: Only available when Template Location is set to All Archives.
User
- User Logged In Status – Determine whether the user needs to be logged in or logged out.
- User Role – Select the User Role(s) needed to trigger the condition.
- User Registration Date – Select the User Registration Date needed to trigger the condition.
Other
- Search – Enter the search criteria necessary for the condition. Note: Only available when Template Location is set to Search Results.
- WP_Query Found Posts Count – Set the number of query results required to trigger the condition. Note: Only available when the Template Location is set to an Archive or Search Results.
- Dynamic Data – Select a Dynamic Data Point to use for the condition.
- Custom PHP – Use Custom PHP to determine how the condition returns true/false.
- Browser – Select the browser(s) to trigger the condition.
- Operating System – Select the operating system(s) to trigger the condition.
- Content Created With – Select whether or not the content needs to be created with Oxygen.
Date & Time
- Day of Week (WordPress) – Select the day(s) of the week to trigger the condition based on the WordPress site’s settings.
- Current Time (WordPress) – Select the time of day needed to trigger the condition based on the WordPress site’s settings.
- Current Date (WordPress) – Select the date needed to trigger the condition based on the WordPress site’s settings.
- Post Date – Select the publish date needed to trigger the condition.
- Post Modified Date – Select the modified date needed to trigger the condition.
- Current Month (WordPress) – Select the month(s) necessary to trigger the condition based on the WordPress site’s settings.
Referrer
- Referrer URL – Apply the condition based on the URL that the user previously visited from. Further Reading on Referrer URL (MDN).
- Referrer Type – Apply the condition depending on the type of referring source (e.g., search engine, direct link, social media).
- Registered Search Engines: www.google.com, www.bing.com, www.yahoo.com, www.baidu.com, yandex.ru, duckduckgo.com, www.ask.com, www.ecosia.org, search.aol.com.
Sessions
- Page View Count – The total number of page views for triggering the condition.
- Session Count – The total session count needed to trigger the condition.
Operands
Each Condition may have one or more operands available to them:
- contains – The item should contain the value set to return true.
- does not contain – The item should not contain the value set in order to return true.
- is – The condition will return true if it is the correct item(s).
- is after – The item value must be after the value set to return true.
- is all of – All selected items must be present for the condition to return true.
- is before – The item value must be before the value set to return true.
- is greater than – The item value must exceed the value set for the condition to return true.
- is lesser than – The item value must be less than the value set to have the condition return true.
- is not – The condition will return true if it is anything but the selected item(s).
- is one of – Any selected item must be present for the condition to return true.