exclude_category Doesn't work with WordPress 3.1
-
Used the code:
function exclude_category($query) { if ( $query->is_home ) { $query->set('cat', '-147'); } return $query; } add_filter('pre_get_posts', 'exclude_category');
to exclude posts from a category from showing up on the front page, but since I updated WordPress to 3.1 it doesn’t work anymore.
EDIT: Also noticed that the URL of categories has changed from “https://www.example.com/?cat=xx” to “https://www.example.com/?category_name=NAMEOFCAT”
How do I fix this?
- The topic ‘exclude_category Doesn't work with WordPress 3.1’ is closed to new replies.