WordPress.org

Support

Support » Themes and Templates » Twenty Eleven Excerpt Length

Twenty Eleven Excerpt Length

  • Just wondering if there would be anyway to pass a number, on a per template basis, to:

    function twentyeleven_excerpt_length( $length ) {
    	return 40;
    }
    add_filter( 'excerpt_length', 'twentyeleven_excerpt_length' );

    Instead of it returning 40 for all excerpts it could return the passed variable that way having custom excerpts lengths in different templates etc…

Viewing 1 replies (of 1 total)
  • Well what does seem to work is to take the above code out of the functions.php file and insert it into each page you want to use an excerpt.

    Change the 40 to whatever you want and viola!

Viewing 1 replies (of 1 total)
  • The topic ‘Twenty Eleven Excerpt Length’ is closed to new replies.
Skip to toolbar