• Hi

    Does anyone have working code for excluding categories in 3.5? I’ve tried adding this

    function exclude_category($query) {
    if ( $query->is_archive ) {
    $query->set('cat', '-1');
    }
    return $query;
    }
    add_filter('pre_get_posts', 'exclude_category');

    in my theme functions.php, to no avail, and I’ve tried adding

    <?php query_posts($query_string . '&cat=-1'); ?>
     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

    to the template for the archive page.

    I’ve tried the Ultimate Categories Exclude plugin but that also doesn’t work – I believe from searching on this topic that none of the currently available exclude plugins are compatible with 3.5.

    Has anyone managed to achieve this?

    Thanks.

    I’m using oxygen theme with wp v 3.5.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Exclude Categories in 3.5’ is closed to new replies.