Sterling – Change Blog Post's Excerpt Length

By default WordPress Blog excerpt is 55 words. To change the Sterling Theme’s Blog excerpt length, follow the bellow instructions:

  1. Access Appearance > Editor
  2. Open up Theme Functions (functions.php) file
  3. Add the following code before the closing PHP Tag ?>:
 function custom_excerpt_length( $length ) { 	return 40; } add_filter( 'excerpt_length', 'custom_excerpt_length', 999 ); 

Adjust the “40” to match the number of words you wish to display in the excerpt: Please note: If you prefer to display the full Post and remove the excerpt, you can do this in Appearance > Site Options > Blog Settings >Blog Post Excerpt If your functions.php file does not have the closing ?> PHP Tag then just add it at the very end of the file.