Viewing 5 replies - 1 through 5 (of 5 total)
  • You will need to use a custom function to control the amount of words in an excerpt.

    Something like this might work:

    function custom_excerpt_length($length) {
     return 300; // Change this word count to whatever you want.
    }
    add_filter('excerpt_length', 'custom_excerpt_length', 20 );

    Thread Starter stevenukasweb

    (@stevenukasweb)

    Where should I put it in? I have tried putting it into custom_functions.php and it doesn’t work. Any suggestions ?

    Are you using a child theme? Ideally, you want to add it to your child theme functions.php file.

    If you aren’t using a child theme… shame on you!! But.. you can add it to your theme’s functions.php file. You’ll just have to redo it anytime you update your theme.

    Thread Starter stevenukasweb

    (@stevenukasweb)

    Josh,I am using thesis theme,dont know if this is child theme,but to me it looks like parent. Also tried uploading it to the functions.php,can’t get that to work.

    Okay, try this one:

    function custom_excerpt_length( $length ) {
    	return 300;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

    Add it to the end of your themes functions.php file. But make sure it’s pasted BEFORE the closing ?> at the bottom of the file.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘how to set read more’ is closed to new replies.