WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] exclude_category Doesn't work with WordPress 3.1

[Resolved] exclude_category Doesn't work with WordPress 3.1

  • Isolacious
    Member

    @isolacious

    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 “http://www.example.com/?cat=xx” to “http://www.example.com/?category_name=NAMEOFCAT”

    How do I fix this?

Viewing 15 replies - 1 through 15 (of 25 total)
Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘[Resolved] exclude_category Doesn't work with WordPress 3.1’ is closed to new replies.