Archived topic
Excerpts not showing, and neither does category descriptions
6 replies · Started by Jimi on October 9, 2021
Hi,
I have written before about excerpts not showing in the blogsection here: https://onlinemarketingbureauet.dk/insights/
I was given a code I should installm but that didn't help.
Now I have seen the same issue in the post categories, that I have written content for. That doesn't show either. It's here: https://onlinemarketingbureauet.dk/email-marketing-tips/
Can you help me ?
Thanks,
Jimi
Hi Jimi,
Can you try creating a test post and add some content without wrapping them in a GB container block?
I believe that would fix the issue. It is explained here:
https://generatepress.com/forums/topic/read-more-button-and-blog-excerpt-suddenly-missing-from-new-posts-2-websites/#post-1940712
The workaround would be to use the excerpt metabox.
Let me know if this helps :)
Hi,
I am not shure I understand. Is it not possible to use GB blocks anymore? And how about the blogcategory pages, they are not using any blocks, but have the same problem?.
And if that's true, that blocks can't be used on blogpages, it sounds more like an issue you need to solve, instead of us users going to redesign all of our post. That's several days of work for me, and it will ruin my design.
It works with this code:
function manual_auto_excerpt($text) {
global $post;
$raw_excerpt = $text;
if ( '' == $text ) {
$text = get_the_content('');
$text = strip_shortcodes( $text );
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
}
$text = strip_tags($text);
/*** Change the excerpt words length. If you like. ***/
$excerpt_length = apply_filters('excerpt_length', 30);
/*** Change the Excerpt ending. If you like. ***/
$excerpt_end = ' ID) . '">' . '» Continue Reading.' . '';
$excerpt_more = apply_filters('excerpt_more', ' ' . $excerpt_end);
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);
}
add_filter('get_the_excerpt', 'manual_auto_excerpt', 5);
It still has some flaws though.
Here is a screenshot that shows that the description from one blogpost is mixed up with the headline of another post. It happens several places in the blogoverview.
And the categorysections are still not showing exerpts
Hi there,
Regarding excerpts on archive pages - when generating an excerpt, WordPress ignores any content inside a 'nested' block. Whether that nested block be a GB Container Block, a core Group block or any 3rd party block. It simply ignores content within them.
The only solid solution today is to write a Manual Excerpt for the posts.
The missing descriptions - looks like your using a Header Element to replace the page title, which replaces the entry header and the description. Disable that element temporarily to see if your title appears.