Archived topic
Customized excerpt length
9 replies · Started by Philippe on August 24, 2018
Hi,
I might not be the only one wondering about this. Is it possible to customize the excerpt length for each article? The introduction of a post is a very important piece of content, as it will decide the reader to go further on or skip to something else, but it cannot be set to a fixed amount of words for each post.
Is there a way to work around this in GP? (a CSS code maybe?)
Thank you!
Hi there,
you can use the Excerpt meta in the post editor to do this. The blob/archives will then display only that content instead.
Hi David,
It works but Read More cannot be displayed as a button anymore. Nevertheless, you put me on the right path and I found out I could use the More tag too.
Best,
Philippe
Glad to be of help :)
Got a problem with setting the excerpt length.
In Customizer, whatever number you use to customize the length, only applies to posts that have nothing in the optional excerpt box. So, if you leave the excerpt field empty, the theme is limiting the automated excerpt accordingly.
But if you write anything in the opțional excerpt box, then the settings in the customizer are not applying to it. Is not limiting the length and is not displaying the Read More.
Am I missing something?
Hi Marius,
That's exactly how it functions, if you'd like customizer to control the length, then leave the optional excerpt box blank. :)
Yes Ying, thank you, that's why I am here, asking how to solve this. How can we have the customizer apply its excerpt length function to the optional excerpt as well or if there is a function to limit the optional excerpt so when posts are shown on your website, they all look the same. Because right now, using the excerpt function in the customizer makes it impossible to display the posts as a grid since some posts will be shortened according to the customizer and some won't since they have some text in the optional excerpt box. More than that, some will show ... and a read more link/button while others won't.
I understand the differences and I am here looking for a solution to the problem I am having. Leaving the optional excerpt box blank is not an option.
Hi there,
Elvin provides a snippet here for setting a length of a manual excerpt:
https://generatepress.com/forums/topic/trouble-setting-the-excerpt-length/#post-1562738
Hi David,
Thank you, was exactly what I was looking for but haven't found (trust me, I searched, but any function I found was coming up short)
Awesome!
Glad to be of help