12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on Jul 10, 2019

[Condition] Archive Type in Oxygen

Sridhar Katakam

This members-only tutorial provides the steps to register a custom condition in Oxygen to control the output of elements on archive pages based on the archive type.

Available Archive Types

Posts page (Blog): This is the blog posts index.

Category: Any category archive.

Tag: Any tag archive.

Taxonomy: Any taxonomy archive page.

Search: Search results archive page.

Author: Any author archive page.

Date: Any date archive page.

Shop/Product Category/Product Tag: WooCommerce Shop or any WooCommerce product taxonomy archive.

Use Case Example

Say you have the blog posts index appearing on your site's homepage (the default setting in WordPress).

You have set up a Oxygen Template that applies to all archives and the blog posts index.

You then added a Section having the archive title heading and do not want this to be shown on the Posts page (i.e., Blog or the homepage, in this case).

Just add the custom condition shown below, select the Section, add a "Archive Type" Condition, set the operator as != and select Posts page (Blog).

This will output the archive title heading section on all archives but the Blog.

Here's How

Install and activate Code Snippets plugin.

Go to Snippets > Add New.

Title: [Condition] Archive Type

Code:

This is a premium members-only content.

To view the rest of the content, please sign up for membership ($47/month or $599 one-time).

Already a member? Log in below or here.

tagschevron-leftchevron-rightchainangle-rightangle-upangle-downfolder-omagnifiercrossmenuchevron-downarrow-right