Below is the code to change the excerpt length (number of words) of WordPress posts.
<?php | |
//* Change excerpt length of WordPress posts | |
function customprefix_excerpt_length($length) { | |
return 50; // pull first 50 words | |
} | |
add_filter('excerpt_length', 'customprefix_excerpt_length'); |