Support reply may delay for 3 weeks due to corona virus outbreak, please send us email to support@pickplugins.com
0
Exclude posts with a tag from category 1
dveersel
Dec 31, 2017 08:11 AM 1 Answers General
Member Since Dec 2017
Subscribed Subscribe Not subscribe
Flag(0)

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
Exclude posts with a tag from category 1
Exclude posts with a tag from category 3
Submit Answer
Please login to submit answer.
1 Answers
Sort By:
Best Answer
0
Exclude posts with a tag from category 4
PickPlugins
Dec 31, 2017
Flag(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/filters-post_grid_filter_query_args/

https://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parameters

Let me know for more help.

Regards

Exclude posts with a tag from category 5
dveersel
- Dec 31, 2017 02:28 PM
Flag (0)
0

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);

Exclude posts with a tag from category 5
dveersel
- Dec 31, 2017 02:28 PM
Flag (0)
0

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);

Sign in to Reply
Replying as Submit