- This topic has 9 replies, 3 voices, and was last updated 4 years, 9 months ago by
David.
-
AuthorPosts
-
June 21, 2021 at 3:45 pm #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,
SvenJune 21, 2021 at 6:47 pm #1830319Elvin
StaffCustomer SupportHi 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; } );June 22, 2021 at 2:55 am #1830649Sven-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.June 22, 2021 at 4:04 am #1830715David
StaffCustomer SupportHi there,
remove the code provided by Elvin and use one of the codes provided here:
https://docs.generatepress.com/article/activating-read-custom-excerpt/
June 22, 2021 at 6:24 am #1830870Sven-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?
June 22, 2021 at 6:29 am #1830874David
StaffCustomer SupportSomething 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' );June 22, 2021 at 6:35 am #1830877Sven-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!
June 22, 2021 at 7:03 am #1830905David
StaffCustomer SupportMight 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.June 22, 2021 at 8:44 am #1831200Sven-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!
June 23, 2021 at 1:38 am #1831872David
StaffCustomer SupportGlad to hear you found the problem – and thanks for letting us know – may come in handy for others 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.