Support » Plugin: Pods - Custom Content Types and Fields » Filter by multiple categories

  • Resolved Kwitelle

    (@kwitelle)


    Hi there,

    I am simply trying to figure out how to filter a pod template by multiple categories. Bellow is the code I use, and it works, but this is only for 1 category. How do use 2 categories?

    [pods name=”MyName” where=”category.name =’MyCategoryName'” limit=”” template=”MyTemplateName”]

    Kind regards
    K

Viewing 1 replies (of 1 total)
  • Plugin Author Jim True

    (@jimtrue)

    You can do that in two different ways:

    If they’re all in the SAME category, just different terms, use:

    where="category.name IN ('Blue','Green','Red')"

    If they’re two completely different taxonomies, you can use the AND in your where clause:

    where="category.name = 'Red' and genre.name = 'SciFi'"

Viewing 1 replies (of 1 total)
  • The topic ‘Filter by multiple categories’ is closed to new replies.