Last active
December 15, 2015 05:39
-
-
Save MikeGillihan/5210785 to your computer and use it in GitHub Desktop.
Custom excerpt lengths for Wordpress. USAGE: <?php echo ows_excerpt(55); ?>
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
function ows_excerpt($num) { | |
$cont = get_the_content(); | |
$more = '… <a href="' . get_permalink() . '">Read More</a>'; | |
$excerpt = wp_trim_words( $cont, $num, $more ); | |
return $excerpt; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment