Tagged Questions
0
votes
1answer
48 views
pre_get_posts : 'post__not_in' doesn't work with global variable
I'm trying to set a post__not_in which use a global $popular variable, defined in the index.php.
-index.php-
$popular[] = 1 //post id=1
$popular[] = 2 //post id=2
$popular[] = 3 //post id=3
...
0
votes
3answers
95 views
using pre_get_posts to exclude
I am trying to use pre_get_posts to exclude categories from posting to the homepage. If I do it like so it works just fine
$query->set( 'cat', '-13,-7,-19,-12,-24,-21,-14');
that is hard coded ...