I am trying to exclude a category in a grid and refer to the following post:
Unfortunately, the argument “post_type = ‘post’” is ignored completely.
What could be the reason?
My Code:
function my_query_args($query_args, $grid_name) {
if ($grid_name == 'Blog') {
// all query parameters can be modified (https://codex.wordpress.org/Class_Reference/WP_Query)
$query_args = array(
'cat' => -94,
'post_status' => 'publish',
'post_type' => 'post',
);
}
return $query_args;
}
add_filter('tg_wp_query_args', 'my_query_args', 10, 2);