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

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems