pre_get_posts : ‘post__not_in’ doesn’t work with global variable
You have to declare $popular to be global before you use it. Based on the code you’ve posted you haven’t done that. global $popular; $popular[] = 1 //post id=1 $popular[] = 2 //post id=2 $popular[] = 3 //post id=3 However, if you mean the index.php in the theme, that file is not always used. You … Read more