Site logo

[Resolved] Custom excerpts not showing when post includes read more block

Home Forums Support [Resolved] Custom excerpts not showing when post includes read more block

Home Forums Support Custom excerpts not showing when post includes read more block

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1717810
    Bandara

    I have a category of posts that includes the “read more” Gutenberg block. They are all standard post types. They all have custom excerpts written in the meta box

    I am configuring the blog archive page to have two columns and show the featured image and and the custom excerpt I have written.

    However, they are showing the full content up until where the “read more” Gutenberg block is. Is this the expected behaviour? I would have expected this if I had selected “full content”.

    I have disabled all plugins other than GP premium and still get this behaviour. I don’t think the solutions on this page apply: https://docs.generatepress.com/article/excerpt-issues/ If they do I will need some coaching to see why.

    Is my only solution to edit all these posts and remove the read more block?

    #1717847
    David
    Staff
    Customer Support

    Hi there,

    its a WordPress function and expected behaviour… the priority is:

    1. More Tag
    2. Custom Excerpt
    3. Auto Excerpt.

    So a More Tag will override a Custom Excerpt.
    Simply DO NOT use a more tag when you have a Custom Excerpt.

    #1718046
    Bandara

    Ah, thanks!

    The reason I didn’t expect that is because I’ve been using the Display Posts plugin and when I use that to show an excerpt, it ignores the more tags. So I was expecting the same behaviour here.

    Thanks for such a quick response.

    #1718049
    David
    Staff
    Customer Support

    You’re welcome!

    #1728241
    Bandara

    its a WordPress function and expected behaviour… the priority is:

    1. More Tag
    2. Custom Excerpt
    3. Auto Excerpt.

    So a More Tag will override a Custom Excerpt.
    Simply DO NOT use a more tag when you have a Custom Excerpt.

    I just realized this may cause a conflict on my site. I have a custom post type for podcasts. In order to prevent all of the page content from going into the rss feed description field, I have to use the more tag if I want the first part of the page content to go into the rss feed. (this is needed because some of the page content doesn’t work well in an rss feed.)

    Do you know any way to override this, or can you give me some of the technical terms I might search for to find the answer on my own?

    #1728469
    David
    Staff
    Customer Support

    Just to be clear – you would require the More Tag to be used for the RSS feed – and the Manual Excerpt to be used for the Post Archives ?

    #1728535
    Bandara

    Yes. The issue is that the podcast plugin I use (Seriously Simple Podcasting) creates a custom post type for the episodes. On those episode pages I use some blocks that end up mucking up the rss feed. So I put the read more break before the fancy stuff.

    But for the tag, category, and post type archive, I would rather use the manual/custom excerpt.

    #1730039
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    You could try something like this:

    add_filter( 'generate_more_tag', function( $more_tag ) {
        if ( ! is_feed() ) {
            return '';
        }
    
        return $more_tag;
    } );

    Let us know 🙂

    #1741075
    Bandara

    I think that did it. Thanks! You guys are amazing.

    #1741926
    Tom
    Lead Developer
    Lead Developer

    No problem! 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.