• Resolved Sea Jay

    (@jcollier)


    This seems simple, but I couldn’t find it in the docs.

    Using the Pods shortcode in a standard page, how do I select only posts with a specific taxonomy term?

    I see how I’d use where to select posts with a particular custom field, but I didn’t see where I’d do the same for a taxonomy term.

    (Of course, this select could be done in a template and called via shortcode. However, the if and each tags appear to reference whether a value exists in a post type. Can they also be used to select a taxonomy term? If so, I couldn’t find the syntax.)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Jim True

    (@jimtrue)

    From the Find documentation (https://pods.io/docs/pods/code/find/)

    You would query against <strong>taxonomy.taxonomy-field</strong>, so if your taxonomy was ‘color’ and you wanted to match the term (which is easiest by ‘slug’), use:

    where="color.slug = 'red'"

    Thread Starter Sea Jay

    (@jcollier)

    Thanks! Lots of power under the hood!

    [pods name="biography" where="biography_department.slug='stewardship'" orderby="last_name" template="Staff-List"]

    I hope this is helpful for others, too.

    • This reply was modified 7 years ago by Sea Jay.
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Display only specific taxonomy term via shortcode’ is closed to new replies.