Oxygen 6 beta 1 now available.

Read announcement

Templating Conditions

In Oxygen, templating conditions give you the power to specify precisely where Templates, Headers, or Footers are applied. This level of specificity ensures that certain designs or layouts only show up in desired areas or under certain circumstances, making your website both dynamic and user-specific.

For instance, you might have a range of posts on your website, and you want a specific template to only apply to a subset of those posts. This is where Oxygen’s templating conditions thrive and let you pinpoint exactly which posts get that template.

Using Templating Conditions in Oxygen

Setting Up Basic Conditions

  1. Find a Template, Header, or Footer in Oxygen’s WordPress admin area and open Settings.
  2. Under Conditions, select the desired condition.
  3. You’ll then be able to select the Operator and the Value.

Using Multiple Conditions with AND and OR

Adding an AND Condition

  1. With an AND condition, both conditions must be true for the template to apply. As an example, if you set conditions like “Post Is [specific post]” AND “User Login Status is Logged In”, the template will only appear for logged-in users viewing that exact post.
  2. To add an AND condition, click the AND button.

Adding an OR Condition

  1. The OR condition means that only one of the conditions needs to be true. You could combine conditions such as “Post Is [specific post]” OR “Author Is [specific author]”. This ensures the template will apply if either of those conditions holds true.
  2. To add an OR condition, click Add Condition.

Verifying Your Conditions

  1. After setting your conditions, visit the front end to check them.
  2. Inspect the posts or pages where the conditions should be in effect and confirm that the correct Template, Header, or Footer shows as expected.

Default Conditions

There are various default conditions available in Oxygen. This article provides a complete list of conditions and operators.

Custom PHP Conditions

You can also use Custom PHP conditions in Oxygen. The Custom PHP Conditions article discusses this and provides some examples.

Updated on: January 6, 2025