Support › General › Post field: how to filter posts of certain categories?
Hi Support team,
I've been using the post field to manually select the related posts for new my posts. When the number of posts increase, it's become frustrating to select among hundreds of post.
I'm looking for a way to exclude certain categories that I don't need.
Please take a look.
You can use the setting query_args to filter posts by taxonomy as well. Please read more on the documentation
Just some simple lines of code to make my life easier.
Thanks for your swift respond.
Here is an example:
'fields' => [
'name' => 'Select a post',
'id' => 'my_post',
'type' => 'post',
'post_type' => 'post',
'field_type' => 'select_advanced',
'query_args' => [
'tax_query' => [
'taxonomy' => 'category',
'field' => 'slug',
'terms' => [ 'aciform', 'comedy' ],