Parse Genesis Excerpts

Community Forums Forums General Discussion Parse Genesis Excerpts

This topic is: resolved

Tagged: ,

This topic contains 6 replies, has 3 voices, and was last updated by  simbasounds 1 year, 4 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #114225


    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)



    Genesis Developer

    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



    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.

    • This reply was modified 1 year, 4 months ago by  simbasounds.
    • This reply was modified 1 year, 4 months ago by  simbasounds.


    I’m still open to suggestions : )


    Genesis Developer

    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.




    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



    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!

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.