Lego2012
12/13/2016 - 10:00 AM

Posts and Pages - Change the length of excerpts

Posts and Pages - Change the length of excerpts

<!-- For some scenarios, the default excerpts don't fit the layout, so you need to change it accordingly. If that's what you need, with your functions.php file opened, copy in it the following code: -->

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

<!-- Tweak the "return 20" line by adding the number of words you'd like to be shown in your excerpts. Remember: the WordPress default value for excerpt length is 55. -->