• Hi, I’m trying to exclude certain categories from my blog, is this correct?

    function myFilter($query) {
    	if ($query->is_home || $query->is_feed || $query->is_archive) {
    		$query->set('cat','-210');
    	}
    
    return $query;
    }
    
    add_filter('pre_get_posts','myFilter');

    but it still shows up under categories, any help with that?

    also in archives, it does exclude post, but still displays +1 extra post that doesn’t exist inside, how to fix that?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘how to exclude categoris from archives?’ is closed to new replies.