Change Excerpt Size

Community Forums Forums General Discussion Change Excerpt Size

This topic is: resolved

This topic contains 2 replies, has 2 voices, and was last updated by  hanuman 1 year, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10486

    hanuman
    Participant
    Post count: 5

    Hi,

     

    I’m using the Sample Child Theme and would simply like to change the excerpt size from 5 lines of text to 7 lines to match the 150px thumbnail size on the category archive page.

    In other words, how do I change the number of characters in the excerpt size?

    I know of the Advanced Excerpt plugin, but is that the  best way to do it?

     

    Cheers and TIA.

    #10626

    Dan
    Participant
    Post count: 22

    Hey hanuman,

    This is the standard fix from the official code snippets (add to functions.php in the child theme)


    /** Modify the length of post excerpts */
    add_filter( 'excerpt_length', 'custom_excerpt_length' );
    function custom_excerpt_length($length) {
    return 50; // pull first 50 words
    }

    I guess you’d have to play with the number of words to get it spot on.

    Does that help?

    #10627

    hanuman
    Participant
    Post count: 5

    Hey Dan,

    That is exactly what I needed!

    Thank you kindly for your help, it’s much appreciated.

     

    Cheers!

     

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Change Excerpt Size’ is closed to new replies.