• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2764

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Premium Access
  • Log in

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

  • How To Use The Old Blog Page Template In Genesis

Blog Page

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.