Last active
September 11, 2022 09:58
-
-
Save terrytsang/4f96f0eca5617078d56abcee70f75c9a to your computer and use it in GitHub Desktop.
change the default length of your excerpts in your WordPress website
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 | |
//add this code into your theme functions.php | |
add_filter( 'excerpt_length', function($length) { | |
return 20; //edit the number to the amount of words you want to show in your excerpts | |
}, PHP_INT_MAX ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment