Site logo

Archived topic

Manual excerpt not displayed on blog page

9 replies · Started by Sven-Philip on June 21, 2021

Viewing posts 1–10 of 10

Dear Team,

I am stuck with the following problem:
I have a blog post with a manual excerpt (https://agnosticinvesting.com/2021/06/philosophy/why-the-name-agnostic-investing/).

I want this excerpt to be displayed on my posts page (https://agnosticinvesting.com/blog/).

As you see, this is unfortunately not the case. The theme always uses the automatic excerpt of 100 words (I configured it that way under Appearance -> Custumize -> Layout -> Blog -> Show Excerpts).

I tried all the stuff that is related in this forum but it does not help (adding various code snippets, testing "break" blocks, etc). The post is set as type "Standard", too.

Any other ideas what the problem may be? It seems that the manual excerpt is just not detected by the system.

Thanks in advance for any type of help!

Kind regards,
Sven

Hi there,

I see you're using the #more tag within the content.

In that case, for the posts to display its manual excerpt, can you try adding this PHP snippet?

add_filter( 'generate_show_excerpt', function( $excerpt ) {
    if ( has_excerpt() ) {
        return true;
    }

    return $excerpt;
} );

Thanks for the hint!

Added the snippet but unfortunately no difference.

Maybe some additional information:
I have no break-blocks in the blog post.
Also, unchecking "Display read more as button" in the Appearance options does not change the issue. Still only the automatic excerpt of 100 words.

I don't like to say it but I tried both snippets and there is still no change.

Any other ideas or known settings that may create problems here?

Something odd - as the Read More link contains a #jumplink in its URL which should only appear if your post has a More Tag in it.

Do you have any other custom functions added to the site?

If you haven't then somethings up with the post.
You can try adding this snippet so GP ignores the more tag:

add_filter( 'generate_more_tag', '__return_empty_string' );

I only have that one to change the heading level of the comment section.

add_filter('comment_form_defaults', 'custom_reply_title');
function custom_reply_title($defaults){
	$defaults['title_reply_before'] = '<h2 id="reply-title" class="comment-reply-title">';
	$defaults['title_reply_after'] = '</h2>';
	return $defaults;
}

The other snippet doesnt work either. Maybe I try to delete the post and do it again later.

Thanks very much anyway!

Might be worth creating a new test post to see if the manual excerpt works - that will identify an issue with that post.
Hope you find the issue.

Found the problem. The "footnotes" plugin created another hook on the excerpt which went on priority.

My fault, apologize the effort and thank you very much for your time!

I mark the issue as solved!

Glad to hear you found the problem - and thanks for letting us know - may come in handy for others :)

This archived topic is closed to new replies.