• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to remove post from home page

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › How to remove post from home page

This topic is: resolved

Tagged: home page

  • This topic has 6 replies, 3 voices, and was last updated 12 years, 4 months ago by JohnnFour.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • December 21, 2013 at 9:42 am #80622
    JohnnFour
    Member

    Hi, I'm using Genesis => Minimum Child Theme.

    My home page is set to "Front Page Displays: Your Latest Posts".

    That works great.

    But there are some posts I'd prefer to exclude from the home page, and I'm having trouble figuring out how to do that.

    It's ok for the posts to be public, they're just not home page material, is all.

    Any ideas?

    Thanks!

    December 21, 2013 at 10:59 am #80629
    Genesis Developer
    Member

    are you wanting to exclude some categories posts from home page?


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    December 21, 2013 at 11:03 am #80630
    Genesis Developer
    Member

    If you want exclude the category then use this in functions.php file

    /** Exclude certain category from posts */
    add_action( 'pre_get_posts', 'be_exclude_category_from_home' );
    function be_exclude_category_from_home( $query ) {
    
        if( $query->is_main_query() && $query->is_home() ) {
            $query->set( 'cat', '-156' ); //use your category ID
        }
    }

    If you want exclude the some specific posts then use this in functions.php file

    /** Exclude certain posts from home page*/
    add_action( 'pre_get_posts', 'be_exclude_post_from_home' );
    function be_exclude_post_from_home( $query ) {
    
        if( $query->is_main_query() && $query->is_home() ) {
            $query->set( 'p', '-26' ); //use your post ID
        }
    }

    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    December 26, 2013 at 9:18 pm #81346
    JohnnFour
    Member

    This worked great.

    Thanks very much, genwrock!

    December 26, 2013 at 9:23 pm #81348
    Genesis Developer
    Member

    You are welcome.


    Download Genesis Featured Posts Combo Widget | Simple Grid Layouts Plugin for Posts, CPTs and terms
    You can request new tips/help.

    December 27, 2013 at 6:54 am #81384
    Brad Dalton
    Participant

    I don't think that 2nd code snippet works based on my testing @genwrock.

    For anyone else, try these 3 different solutions http://wpsites.net/web-design/3-ways-to-remove-posts-from-your-home-page-loop/


    Tutorials for StudioPress Themes.

    December 27, 2013 at 10:25 am #81408
    JohnnFour
    Member

    Yeah, the behaviour was unexpected. It's an inclusion type function really, but in that way it's exclusive. 🙂

    So I created a Category called Feature and added the id to the function. Now my home page displays only posts categorized as Feature, which is perfect for my use case.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble