You can use the where property to filter based on categories or fields.
It actually uses Pods::find(): https://docs.pods.io/code/pods/find/
Cheers, Jory
Hi Jory, thanks for your reply.
I am still a bit lost … when I created the taxonomy: »sponsors«
and subcategories like: festivalsponsor, supporters and cooperations,
what exactly do I type into the »where-field« within widget »Pods – List Items«
to show only the category on a specific page?
Since I’ve chosen:
Pod = Sponsors
Template = Sponsors_List
.
Where = ?
“category.name = ‘My Category'” (?)
equals
“sponsors.festivalsponsor = ‘Festivalsponsor'” (?)
When I leave the »where« field empty, it shows all entries.
Why is it so difficult to find any information, what to actually fill in those fields?
Hi @blindtexth
Sorry, you cannot traverse into relationships for the where arg since that is SQL.
category.name = 'My Category'
Equals to:
sponsors.name = 'Sponsor' (?)
– sponsors would be the slug of the taxonomy (not the term!).
– name is the actual database table column.
So for a subcategory you could just do the following:
sponsors.name = 'Name of your subcategory'
Or
sponsors.slug = 'slug-of-your-subcategory'
Or
sponsors.term_id = 12
Or for multiple categories:
sponsors.slug IN ( 'term-slug-1', 'term-slug-2', 'term-slug-3' )
You can find some more examples using a shortcode here:
https://docs.pods.io/displaying-pods/pods-shortcode/
Hope this helps!
Cheers, Jory
Hi @keraweb
thank you for your help … it works with:
»where« – <sponsors.slug = ‘festivalsponsor’>
Highly appreciated!!
Hi @blindtexth
You’re welcome! The best way to say thanks is to leave a 5 star review at https://wordpress.org/plugins/pods/ and (if you’re feeling especially generous) become a Friend of Pods at https://friends.pods.io/
Cheers, Jory
Hi Jory,
actually I am a »Friend of Pods« 🙂
Saludos, Carsten