Created
December 17, 2017 07:28
-
-
Save version-control/fc2b4d718470f36aeb54eac9f3c6cd9b to your computer and use it in GitHub Desktop.
WP Theme Function For Excerpt Word Length
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
/** | |
* Filter the except length to 10 words. | |
* | |
* @param int $length Excerpt length. | |
* @return int (Maybe) modified excerpt length. | |
*/ | |
function wpdocs_custom_excerpt_length( $length ) { | |
return 10; | |
} | |
add_filter( 'excerpt_length', 'wpdocs_custom_excerpt_length', 999 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment