• 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

travisdotmedia

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
  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 8, 2017 at 6:31 am in reply to: Exclude Category Not Working #210110
    travisdotmedia
    Member

    Thanks Brad! So I just changed my Static Front Page option in the Customizer so that the Front Page displays the latest posts and the exclude works. So this does not work on the blog pages if you set a static homepage?

    August 8, 2017 at 5:21 am in reply to: Exclude Category Not Working #210106
    travisdotmedia
    Member

    Hi Brad,

    On Travis.media, I am not using any code to exclude. If I put it a category ID into the Exclude Category field, it does not seem to work.

    On the other site (patrickoben.com) I remove the code and place the ID in the field and it does not seem to exclude.

    Currently the code is in place. It is,

    add_action( 'pre_get_posts', 'exclude_category_from_blog' );
    function exclude_category_from_blog( $query ) {

    if( $query->is_main_query() && $query->is_home() ) {
    $query->set( 'cat', '-5171' );
    }
    }

    This code works. Does Genesis exclude under the same conditionals?

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)

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