12% off of LTD using this coupon: TWELVEPERCENTOFF. Promo ends on 2 Dec midnight UTC.
Published on Mar 28, 2022

Get Current Taxonomy and Term ID for Advanced Queries in Oxygen

Sridhar Katakam

This members-only tutorial provides the steps to set taxonomy and terms query params in Oxygen's Advanced Query to be dynamic/automatic.

Scenario:

There are multiple taxonomies each attached to multiple post types.

Ex.:

CPTs of interest: investigation besides the built-in post
Taxonomies: format, country, company
A sample term of the format taxonomy: podcast

Requirement:

When viewing a term archive page of any of the above taxonomies, for example:

https://example.com/format/podcast/

a) show the items of a specific post type, say post that have the current term of the current taxonomy in a custom loop.

i.e.,

show posts that have been marked as podcast format.

b) show the items of a different post type, investigation that have the current term and current taxonomy in another custom loop.

i.e,

show investigations that have been marked as podcast format.

c) have a single Template for all the taxonomies.

Solution:

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