Archived topic
Manual Excerpt Not Respecting the Word Count
3 replies · Started by Eric on November 26, 2021
I have 2 type of posts.
Some are written and some are drivent by shortcodes reading from the database.
In the second case, I have to manually add an excerpt because there is nothing generated due to the shortcodes I assume.
I am all good up to here. However, I set the word count in the Customize->Layout->Blog and it's not respected for the manual excerpt.
Is there a way to make it respect it?
Working Category: https://dividendearner.com/investing/top-dividend-stocks/
Not Working Tag : https://dividendearner.com/stock/sector-communication-services/
Thanks.
Hi there,
WordPress doesn't trim Manual excerpts - as you generally want 100% of the manual excerpt to display.
You can try the snippet i provided in this reply:
https://generatepress.com/forums/topic/limit-for-post-excerpt-lenght/#post-1430489
thanks.
Can I ask for one more favor, is it possible to read the settings for wordcount instead of hardcoding the number like 55?
s it possible to read the settings for wordcount instead of hardcoding
Hi Eric,
Not sure what this means. Are you asking if the manual excerpt length can use the setting value in customizer?
I think using David's snippet should work.
Let me know if I miss anything.