Site logo

[Resolved] Manual excerpt not displayed on blog page

Home Forums Support [Resolved] Manual excerpt not displayed on blog page

Home Forums Support Manual excerpt not displayed on blog page

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1830265
    Sven-Philip

    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

    #1830319
    Elvin
    Staff
    Customer Support

    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;
    } );
    #1830649
    Sven-Philip

    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.

    #1830715
    David
    Staff
    Customer Support

    Hi there,

    remove the code provided by Elvin and use one of the codes provided here:

    https://docs.generatepress.com/article/activating-read-custom-excerpt/

    #1830870
    Sven-Philip

    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?

    #1830874
    David
    Staff
    Customer Support

    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' );

    #1830877
    Sven-Philip

    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!

    #1830905
    David
    Staff
    Customer Support

    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.

    #1831200
    Sven-Philip

    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!

    #1831872
    David
    Staff
    Customer Support

    Glad to hear you found the problem – and thanks for letting us know – may come in handy for others 🙂

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