• 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

Parse Genesis Excerpts

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 › Parse Genesis Excerpts

This topic is: resolved

Tagged: parse, shortcodes

  • This topic has 6 replies, 3 voices, and was last updated 11 years, 7 months ago by simbasounds.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • July 14, 2014 at 8:03 am #114225
    simbasounds
    Member

    I'm not sure if this is a Genesis question or a WordPress question, but here goes:

    Is there a way to get truncated archive content (aka auto excerpts) - as set in Genesis Theme Settings - to parse as normal post content? Or else limit archive content, while retaining parsing?

    If you choose Display Post Content and Limit content to 0 characters it will display ALL content from the posts in the archive, and parse shortcodes.

    If you choose, for example, Limit content to 300 characters, then it does what it says it's going to do ie.
    "Using this option will limit the text and strip all formatting from the text displayed", which means any shortcodes will not be processed.

    I need to limit my content, AND parse shortcodes.
    (manual excerpts are not an option: it's an existing site with 100s of posts)

    Possible?

    July 14, 2014 at 8:49 am #114227
    Genesis Developer
    Member

    Add the following code in your functions.php file

    add_filter('the_content_limit', 'do_shortcode');
    add_filter('the_content_limit', 'the_custom_content_limit');
    function the_custom_content_limit($content){ return wpautop($content);}

    Note: I did not test the code. So I am not 100% sure that it'll work or not


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

    July 14, 2014 at 10:20 am #114237
    simbasounds
    Member

    Thanks Genwrock,

    It didn't work, but I think that may be on the right track. At least I know the filter for the_content_limit now.

    And I'm understanding the problem better now:
    With or without that code I couldn't see the actual shortcodes eg. [my_shortcode]
    So they are being processed, but not rendered when content is being limited.

    The shortcode in question is for the Youtube Lyte plugin, but actually it's WordPress video URLs which are not being parsed. When I enter Youtube URLs in the text editor for a post, they show as videos on the post, but not in the archive with content limit on, where they show as unprocessed URL text.

    July 14, 2014 at 11:00 am #114242
    simbasounds
    Member

    I'm still open to suggestions : )

    July 14, 2014 at 11:27 am #114250
    Genesis Developer
    Member

    Ok. i checked this function get_the_content_limit . it is removing the shortcode so the content truncation count is done correctly . If you want shortcode then you need to modify the lot of code. First you need to disable the "genesis_do_post_content" hook using the conditional tag. Then you need to create a new function for post content and that function will allow the short code

    You need to modify the following functions

    1. genesis_do_post_content (this function is calling the the_content_limit() ) // structure/post.php file
    2. get_the_content_limit (this function is calling from the_content_limit() function) //path is functions/formatting.php file

    NOTE: Do not modify the core and Genesis Framework. You will write the code in your child theme file

    Best of Luck.

    Chinmoy


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

    July 14, 2014 at 11:32 am #114251
    Summer
    Member

    There's a plugin called Advanced Excerpt that will enable or disable shortcodes in excerpts.

    That's a newer addition to the plugin since I last used it (and I haven't used it in a long time but liked it when I did), but it looks like it might be an option for you to try out.


    WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
    Slice of SciFi | Writers, After Dark

    July 14, 2014 at 12:05 pm #114257
    simbasounds
    Member

    Normally I'd try the longer solution and learn something in the process, but I'm on a tight deadline so I went with Advanced Excerpt and it worked. Thanks so much Chinmoy and Summer!

  • 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