This snippet will let you define a new custom default excerpt length for the WordPress excerpts output. The following example will set the default excerpt length to 20 characters.

Instructions
Add this code to your functions.php file.

<?php
   function new_excerpt_length($length) {
      return 20;
   }
   add_filter('excerpt_length', 'new_excerpt_length');
?>

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Recent Articles

left
Right