Exccerpt length
-
Hi all
I want to shorten the excerpt-lenght
Who can/will help me and tell me what I need to do?
Thank you in advance
♫ M e l ☺ d y ♫
http://melodymusic.nl
-
Hi there,
Our Blog add-on allows you to do that in the Customizer.
Otherwise, you can use the excerpt_length filter:
add_filter( 'excerpt_length','tu_custom_excerpt_length', 20 ); function tu_custom_excerpt_length() { return 50; // Integer stating the number of words }Adding PHP: https://docs.generatepress.com/article/adding-php/
-
This reply was modified 9 years, 2 months ago by
Tom.
Thank you Tom for replying and offering me something that might help but sadly it doesn’t.
I had tried that already in functions.php of the GeneratePress (Mother) -theme … as well as changing the amount in funcions.php of Forefront theme itself…
What version of GP are you using?
1.3.46
The one that came with Forefront as I downloaded it…
Any chance you can link me to your blog page?
😊 in my first post beneath my name 😉
http://melodymusic.nlUgh, sorry about that! 🙂
Can you try changing your blog post content option to “Excerpt” in Customize > Blog?
Thank you Tom for helping me!
I don’t have to change it because that is the setting already.
The reason you don’t see it is because I choose a content type other then Standerd, and U use the wp-read more function in a separate post 😉
To let you see what you need I’ve changed the settings of this post…
http://melodymusic.nl/onherstelbare-schade/Greetings
Ah, if you use the more tag (https://docs.generatepress.com/article/using-the-more-tag/), your excerpt length you have set will be ignored, and the excerpt will cut off wherever you manually applied the more tag.
If you don’t use the more tag, then the value you set in the above function will work.
Let me know if that makes sense or not 🙂
Hi There
I’ve started to use the more-tag because the excerptsetting does not work 😉
What you are saying makes sense but I wish it worked like it should 😑
the post I linked you … in there I did not use the more tag… so you could see that the excerptfunction does not work as it is supposed to
What value did you set in the custom function I provided above?
Sorry … out all day..
5
Hmm, that is very strange.
Give this function a shot instead of the one above:
add_filter( 'excerpt_length','tu_custom_excerpt_length', 100 ); function tu_custom_excerpt_length() { return 5; // Integer stating the number of words }Make sure the post you’re testing doesn’t have the more tag added 🙂
-
This reply was modified 9 years, 2 months ago by
The topic ‘Exccerpt length’ is closed to new replies.
