Calling all WordPress Gurus.
I am trying to block posts from a category from showing up on the front page. I tracked the category number down and put this code at the end of my functions.php file, but they are still showing up.
-
// remove from home page
-
function exclude_category($query) {
-
if ( $query->is_home ) {
-
$query->set(‘cat’, ‘-11');
-
}
-
return $query;
-
}
-
add_filter(‘pre_get_posts’, ‘exclude_category’);
-
// remove from home page
Am I supposed to put a call to this in my Index.php? Or am I missing something? Did they change how this works with WP 3?


