• 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

Excluding Category in Featured Post

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 › Design Tips and Tricks › Excluding Category in Featured Post

This topic is: not resolved

Tagged: exclude category, genesis sandbox featured content, modern portfolio

  • This topic has 4 replies, 4 voices, and was last updated 11 years, 9 months ago by Tom.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • June 5, 2014 at 2:30 pm #108208
    Michael_S
    Participant

    I'm using Modern Portfolio Pro and am wondering if it is possible to exclude a specific Post category from appearing in the Home>Blog widget area of my home page yet still appear in the Home>Portfolio widget area.

    The "Featured Post" widget is used for both.

    I'm sensing this is a "you can't have it both ways" circumstance.

    This bit of php posted a year ago by Brad Dalton looked promising, but I was unable to get it to work:

    d_action( 'pre_get_posts', 'exclude_category_posts_home' );

    function exclude_category_posts_home( $query ) {

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

    (substituting "portfolio" for "category" and used Cat ID "8")

    I'd appreciate some insight. Perhaps pair-up a Text Widget and a dash of php?

    Thanks

    Mike

    http://www.test.puebloperiodically.com/
    June 5, 2014 at 2:34 pm #108210
    mpet29
    Member

    I needed to do the same thing on a previous site, and also ran into your issue. What I did to get around it was to make that category a custom post type, which kept it out of the main feed, and then I had a widget that was set to ONLY show that post type.

    June 5, 2014 at 2:40 pm #108214
    Kyle Rumble
    Member

    I've never used the theme before, but if its a blog category you should only have to change the cat id.

    $query->set( ‘cat’, ‘-8′ );

    Or maybe try this plugin: https://wordpress.org/plugins/flexible-posts-widget/ you can filter by CPT, Taxonomy/Cat, and even Post ID's.

    June 6, 2014 at 6:10 am #108301
    Michael_S
    Participant

    Thanks, gentlemen. I'm gonna poke around some more and see what I can come up with; I appreciate your suggestions.

    Mike

    June 7, 2014 at 12:57 am #108431
    Tom
    Participant

    exclude a specific Post category from appearing in the Home>Blog widget area of my home page yet still appear in the Home>Portfolio widget area.

    You can do this with a plugin to control the post output by category in the Home Blog widget area. Try using Genesis Sandbox Featured Content Widget -- you will have do use a slightly older version (1.1.3 vs 1.1.4) as the current version ability to select (include) a single category is broken. Get 1.1.3 >here<.

    Once loaded and activated, use this plugin to output blog posts (Taxonomy and Terms: All Taxonomy and Terms), but exclude the post category/categories by specifying their category ID(s) in "Exclude Terms by ID (comma separated list)". Specify other characterstics as desired for image, title, excerpt, etc.

    Your portfolio section can stay as-is or use GSFC widget to control output there, too.


    Choose your next site design from over 350 Genesis themes.
    [ Follow me: Twitter ] [ Follow Themes: Twitter ] [ My Favourite Webhost ]

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘Design Tips and Tricks’ 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