Archived topic
Custom excerpts not showing when post includes read more block
9 replies · Started by Bandara on April 1, 2021
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?
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.
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.
You're welcome!
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?
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 ?
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.
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 :)
I think that did it. Thanks! You guys are amazing.
No problem! :)