Ready to get started?Download WordPress


[resolved] Increase the number of words displayed on homepage post preview (4 posts)

  1. joshgarrod
    Posted 1 year ago #

    Hi everyone,

    My current theme displays my recent posts on my homepage with a sohrt preview of their content. I would like to increase the number of words the preview displays. Any ideas how I cold do this please:


    Thanks in advance,


    [ Moderator note: It's this theme http://wordpress.org/extend/themes/infinity ]

  2. riversatile
    Posted 1 year ago #


    By default, excerpt length is set to 55 words. To change excerpt length using "excerpt_length" filter, add the following code to your theme's functions.php file :

    function custom_excerpt_length( $length ) {
    	return 20;
    add_filter( 'excerpt_length', 'custom_excerpt_length', 100 );

    In this example, the value "100" will display excerpts limited by 100 words.

  3. Allen Moore
    Posted 1 year ago #

    Hey @joshgarrod. You may want to create a child theme and place the code provided by @riversatile in the functions.php file for that child theme. If you add it to the current functions.php file, you will lose that info if a theme update comes out and you update it.

    Here is some info on how to do this:

  4. joshgarrod
    Posted 1 year ago #

    Amazing, thanks very much for your help guys! Topic solved!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.