Change Post Snippet Length on Blog Index Page

Discussion in 'Local Business WordPress Theme' started by bpmarketing11, Mar 4, 2014.

Thread Status:
Not open for further replies.
  1. bpmarketing11

    bpmarketing11 Member

    Joined:
    Dec 28, 2011
    Messages:
    49
    Likes Received:
    3
    Hello,

    I would like to know how to change the post snippet length on the Blog index page?

    Right now the whole post shows and without any formatting (like paragraph breaks, headings, etc).

    You can see it here: http://www.goldenplumbinginc.com/blog/

    Can you please tell me how to correct this?

    Bradley


     
  2. Gourav

    Gourav Support Staff

    Joined:
    Oct 19, 2012
    Messages:
    7,728
    Likes Received:
    207
    Hello,

    Go to functions.php present in your theme directory and add the code given below

    Code:
    function custom_excerpt_length( $length ) {
        return 40;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); 
    Check image for reference

    2014-03-05_1258.png


    Change "return" value as per your requirements.


    Thanks & Regards
    Gourav Shrivastava
     
  3. bpmarketing11

    bpmarketing11 Member

    Joined:
    Dec 28, 2011
    Messages:
    49
    Likes Received:
    3
    Worked perfectly, thanks.
     
Thread Status:
Not open for further replies.

Share This Page