Site logo

Archived topic

Excerpts not showing, and neither does category descriptions

6 replies · Started by Jimi on October 9, 2021

Viewing posts 1–7 of 7

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.

https://nimb.ws/pEiqYU

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.

This archived topic is closed to new replies.