0
dveersel
I want to create a Post Grid for all posts with (for example) category A, but exclude the ones that have (for example) tag 1. How do I set up the grid so that I can exclude certain posts based on their tag?
2 Subscribers
Submit Answer
1 Answers
Best Answer
0
Welcome to our forum.
I can see currently you can't query like this way you are looking for, although you can use filter hook for query arguments, please see the documentation here
https://pickplugins.com/documentation/post-grid/filter-hooks/post_grid_query_args/
https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters
Let me know for more help.
Regards
Thanks for the help. I tried to write a custom CSS script based on this, but it is not working for me (yet):
function post_grid_filter_query_args_extra($query_args, $grid_id){
if($grid_id==71256){
$extra_query = array (
'tag__not_in' => array('1283'),
);
$query_args = array_merge($query_args, $extra_query);
}
return $query_args;
}
add_filter('post_grid_filter_query_args','post_grid_filter_query_args_extra',10,2);