Post Excerpt Length
URL to the page in question:
-
Hi Bill
You mention, via this post, that the post excerpt is the first 55 words of a particular post.
Is it possible to change this to a smaller number?
I would like to have shorter excerpts via the Home Page Posts widget without having to install a separate plugin to achieve this.
Thanks.
Great question. You can have a shorter excerpt. Here’s how to do that:
- Go to the appearance section of your WordPress control panel and select edit.
- From the list of files on your right, choose functions.php.
- Scroll down to the very bottom and paste this just above the
?>
function elwynvds_custom_excerpt_length( $length ) {
return 20;
}
add_filter( 'excerpt_length', 'elwynvds_custom_excerpt_length', 999 );
- Save your changes.
That will change the default excerpt length from 55 words to 20. To choose a different number, just change the “20” in the snippet above.
If you run into any questions or trouble, let me know,
Bill
Awsome! Works as expected.
Thanks Bill.
- The topic ‘Post Excerpt Length’ is closed to new replies.