Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #306628

    Hey Guys – I’d like to be able to exclude some categories from the main blog page – loooong story but I need to exclude it from the single.php, is there a way to do this in the funciotions or the child theme?



    Hi ShortieD!

    Please add following code to Functions.php file in Appearance > Editor

    function exclude_category_blog($query) {
    if ( $query->is_home() ) {
    $query->set('cat', '-33');
    return $query;
    add_filter('pre_get_posts', 'exclude_category_blog');

    and change 33 with category ID you would like to hide – (Purchase code hidden if logged out) -id-number


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.