Tagged: , , ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #301103

    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.

    #301467

    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

    #301499

    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 :)

    • This reply was modified 10 years, 4 months ago by gmarco.
    #301911

    Hey!

    The read-more tag should work when you use this setting:

    Cheers!
    Josue

    #302468

    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.

    #302708

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.