Created
November 26, 2019 18:27
-
-
Save JoseSoteloCohen/898cde29e799c8d1d66d2366cf43045d to your computer and use it in GitHub Desktop.
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
// functions.php // | |
function custom_post_excerpt_length($post_excerpt, $post) | |
{ | |
$length = 70; | |
$excerpt = strlen($post_excerpt) > $length ? mb_substr($post_excerpt, 0, $length - 3, "utf-8") . "..." : $post_excerpt; | |
return $excerpt; | |
} | |
add_filter('get_the_excerpt', 'custom_post_excerpt_length', 20, 2); | |
// end functions.php // |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment