Changing the excerpt length in WordPress

To change the excerpt length in WordPress, it’s quite simple.

Edit the functions.php file in your theme, then add the following php code:

add_filter('excerpt_length', 'my_excerpt_length');
function my_excerpt_length($length) {
return 20; }

You can change the value (in our case 20) to the number of characters you’d like your excerpt to be.

mirkohumbert

Comments

No comments yet.

Write a comment

You must be logged in to write a comment.

« »