Created
October 14, 2019 09:39
-
-
Save aaronsummers/3c1a7a7126eb9d7bae1ab4b6d0146e57 to your computer and use it in GitHub Desktop.
Custom excerpt 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
<?php | |
$excerpt = get_the_excerpt(); | |
echo ( strlen($excerpt) > 40 ) ? mb_substr($excerpt, 0, 40, "utf-8") ."..." : $excerpt; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment