Archived topic
Blog Archives Content Type Excerpt fail
10 replies · Started by David on September 26, 2018
I've made the settings to display the Excerpt for Archives with the Blog addon as documented:
https://docs.generatepress.com/article/blog-content-layout/#archives
But the full content is still displayed, rather than post excerpts:
https://l365.wordimage.us/2017/12/
Scroll down to the December 25, 2017 post showing the full content of 134 words, rather than a shorter excerpt of 11 words. Tried toggling the Content type and Excerpt word count settings, but nothing ever changes. What am I missing?
I'm finding the same issue.
Inside of Customizer/Layout/Blog, I have selected the "Archives" section, changed the "Content Type" to "Excerpt" and the "Excerpt word count" to 20,40, or what ever and it does not shorten the text.
In addition, the "Read more label" does not appear either (with or without the [X] Display read more as button.
David - I'm not seeing that post? Did you change it up?
Tim - I'd need to see your site to know for sure.
Things that will prevent the excerpt from showing:
1. The more tag has been added to the content.
2. The post format is something other than "standard".
Tom, I don't see a private area to leave my link since I didn't start this topic.
However, if you go to my site /blog you will see the post in question. The text should be capped at 10 words and the read more button is enabled. Yet they do not show.
You can get my URL from a previous topic I started here: https://generatepress.com/forums/topic/hero-section-premium-1-7rc2/
Tom, yes indeed, the image post format was used for this blog. (Oops, the order was switched to ASC with a function, so the posts are displayed differently.)
Can this be fixed with a function using a generate_show_excerpt filter?
https://docs.generatepress.com/article/generate_show_excerpt/
Or would an image post format template be needed?
Thanks!
Tom, to clarify, my blog post is using the standard layout.
David - try this:
add_filter( 'generate_show_excerpt', function( $show ) {
if ( 'image' === get_post_format() ) {
return true;
}
return $show;
} );
Tim - your element is using entry-summary, so GeneratePress is expecting the excerpt. However, your content is wrapped in <p> tags, so something is allowing HTML within the excerpt. A plugin or function maybe?
That filter looks like a solution. I'll take time to set up a test of it.
However, this was a 'migration' out of WordPress.com (ugh...), and the image post format seemed like an albatross causing other issues, so I found a way to change all the posts to standard, along with setting up attached featured images, which (WP.com exports loses attachment meta).
Now the Blog addon works great as expected. Thanks!!!
Awesome :) No problem!
Tom, actually the <p> seems to be added on it's own, even if I clear the post and it's not really the issue. In fact, why would html break this when html is allowed in the post content?
What is really causing the issue is the "Excerpt" text. If I add anything in the Excerpt field it is displayed (as I would expect) but the blog settings in the customizer do not apply. If I remove the excerpt it then shows the read more button and the word count limit is followed.
Thoughts?
Ah yes, adding a custom excerpt will overwrite the default excerpt length, as you've specified your own excerpt instead of asking GP to do it for you.
For the read more, you can do something like this: https://generatepress.com/forums/topic/custom-home-page-excerpt/#post-178361