Change Excerpt Length in WordPress

Change Excerpt Length in WordPress

This is a small but very useful tweak.

What is excerpt ??

It may be a very simple question for those who are expert in wordpress, but I wanna repeat the answer here for beginners . In one word, excerpt is the summary of Post content in wordpress. Excerpt is normally being used in archive pages.

Control Length Of Excerpt 

Sometimes you may need to cut the excerpt in a specific place. So, Here is the solution for this : Copy the codes below & paste it to your theme’s functions.php file.
add_filter('excerpt_length', 'my_excerpt_length');
function my_excerpt_length($len) { return 75; }

 

You can change  75 to any number & the excerpt will cut in that specified place.

 

Leave a Reply

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