Thursday, April 10, 2014

How to Change the Default Excerpt Length in Wordpress

Steps to change excerpt length

We can easily change the excerpt length without plugin in wordpress.

Description:

The excerpt is summary or description of a post.

Steps:

1.In your wp-content->themes->Your-theme->functions.php add the below lines end of your file.
2.Add these lines
<?php

/* Change Excerpt length */
function custom_excerpt_length( $length ) {
   return 30;
}
add_filter('excerpt_length', 'custom_excerpt_length', 999 );

?>
3.Save your functions.php.

No comments:

Post a Comment