Hello,
I’m using custom layout for blog page (which is fontpage and blog page).
How can I edit the excerpt lenght?
I’ve tried adding the following code in theme functions.php without success.
add_filter('excerpt_length', 'my_excerpt_length');
function my_excerpt_length($len) { return 75; }
Thank you best regards,
Guillermo.
Hey gmarco!
Thank you for using Enfold.
You can edit includes > loop-index.php, find this code on line 186:
echo $content;
Replace it with:
if(!is_single()) { echo wp_trim_words( $content, 10 ); } else {
echo $content;
}
Increase the value 10 if necessary.
Best regards,
Ismael
Ok that works but I would like to display “Read more” link or custom button also.
Is it possible to vary excerpt lenght depending on where you place “read more” separator on post.
I mean set default excerpt value with custom function. Apply it if not “read more” separator defined.
If read more separator defined show text until read more.
In both cases display read more button/link to full content :)
Hey!
The read-more tag should work when you use this setting:
Cheers!
Josue
I’m finally not using a custom page. Just let the theme display blog. It works better for me.
However on default blog I can’t edit excerpt length or add Read more link.
Hey!
To insert a Read More link in the post content you have to enter
<!–more–>
in the text of the content, where you want to display it.
Have a look at http://codex.wordpress.org/Customizing_the_Read_More
and the sections
Modify The Read More Link Text
and
Displaying a “more…” link when using the the_excerpt()
for more information how to customize.
Best regards,
Günter