• 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

Exclude post Category from showing up in blogroll

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 › Exclude post Category from showing up in blogroll

This topic is: resolved

Tagged: exclude category

  • This topic has 3 replies, 3 voices, and was last updated 8 years, 3 months ago by Ken Jensen.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • November 16, 2015 at 6:17 pm #171315
    erh
    Member

    Hello,

    I finished writing about ten different articles, all grouped together in a single "series".

    I prefixed each article with something like "This article is number 3 of 10 in a series on [something]". But when I look at my blogroll, the excerpt of each post is now my "series prefix".

    I don't want to write a custom excerpt for each post. I'm perfectly content with WordPress automatically selecting the first 50~ words (or whatever).

    I just need to exclude a block of text from being selected as excerpt text.

    What is the easiest way to do this without requiring an additional plugin, or requiring me to manually write all the excerpts going forward?

    November 16, 2015 at 10:54 pm #171320
    Brad Dalton
    Participant

    Try pre_get_posts


    Tutorials for StudioPress Themes.

    November 16, 2015 at 11:27 pm #171321
    erh
    Member

    Brilliant, that did it perfectly. Thanks BradDalton!

    Here is the code I used if anyone else comes across this from a search. I added it to my functions.php through this plugin:
    https://wordpress.org/plugins/add-actions-and-filters/

    function exclude_category( $query ) {
        if ( $query->is_home() && $query->is_main_query() ) {
            $query->set( 'cat', '-17' );
        }
    }
    add_action( 'pre_get_posts', 'exclude_category' );
    

    (17 was the ID of the category I wanted excluded).

    August 3, 2017 at 8:22 pm #209965
    Ken Jensen
    Member

    I had same issue. Theme settings not responding. Custom field suggestion found elsewhere not working. This worked! Thanks Brad!

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 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

© 2025 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