Created
June 26, 2018 14:53
-
-
Save danstramer/a32bacf1b44199074e7ed814faaa32ea to your computer and use it in GitHub Desktop.
Wordpress custom excerpt
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
add_filter('excerpt_length', 'my_excerpt_length'); | |
function my_excerpt_length($length) { | |
if(is_front_page()) { | |
return 9; | |
} else { | |
return 40; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment