Important:
This support area is for Kalium 3 users only. Support for Kalium 4 has moved to our new platform at support.laborator.co. If you’re using Kalium 4, please create a new account there using your email and license key. A password will be sent to you automatically.

Okay
  Public Ticket #2542579
Hiding a category of posts in the blog
Closed

Comments

  •  2
    transparenceco started the conversation

    I want my blog page to show all post categories except the careers category which will have its own page.

    What is the cleanest way to do this in your theme?

    Thanks

  •  2
    transparenceco replied

    Never mind I added the following function and got what I wanted, thanks!

    function exclude_category_home( $query ) {
    if ( $query->is_home ) {
    $query->set( 'cat', '-5' );
    }
    return $query;
    }
     
    add_filter( 'pre_get_posts', 'exclude_category_home' );


  • [deleted] replied

    I'm happy to hear thatsmile.png

    Have a great day!