Categories

Featured templates

WordPress. How to exclude category from displaying on Blog page

Celine Jade August 31, 2015
Rating: 5.0/5. From 2 votes.
Please wait...

This tutorial is going to show you how to exclude category from displaying on Blog page in WordPress.

WordPress. How to exclude category from displaying on Blog page

If you want to exclude category from displaying on Blog page, perform the following steps:

  1. Go to your WordPress admin panel, navigate to Appearance -> Editor:

    how to exclude category from displaying.1

  2. Look for custom-function.php file of your theme##### and open it to edit.

  3. Add this piece of php code to the file mentioned above and save changes:

    function exclude_category( $query ) {
    if ( $query->is_home() && $query->is_main_query() ) {
    $query->set( 'cat', '-17' );
    }
    }
    add_action( 'pre_get_posts', 'exclude_category' );

    how to exclude category from displaying.2

Feel free to check the detailed video tutorial below:

WordPress. How to exclude category from displaying on Blog page

Popular Wordpress Themes
This entry was posted in WordPress Tutorials and tagged blog, category, exclude, page, WordPress. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket