Below is the code to change the excerpt length (number of words) of WordPress posts.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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'); |