Exclude Categories From Home Which Show On Blog Page in Genesis

This solution enables you to display posts from one or more categories on any page using the Genesis blog page template and exclude the same posts from displaying on your home page.

Exclude Categories From Blog Page Template

Use settings like these to exclude the categories you don’t want displayed on your blog page.

blog page template

The above example shows posts from categories with the I.D of 1,2 & 3 have been excluded from displaying on any page using the blog page template in Genesis.

Home Page Categories

Now you can use PHP code in your child themes functions file to only display posts from categories categories with the I.D of 1,2 & 3.

function home_page_categories( $query ) {
    if ( $query->is_home() && $query->is_main_query() && !is_admin() ) {
        $query->set( 'cat', '1,2,3' );
    }
}
add_action( 'pre_get_posts', 'home_page_categories' );

Related Tutorials

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.