Created
June 5, 2012 16:47
-
-
Save billerickson/2876185 to your computer and use it in GitHub Desktop.
Truncate by word or character
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 | |
// Trims by word | |
wp_trim_words( $text, $num_words, $moretext ); | |
// Trims by character (and strips HTML) | |
wp_html_excerpt( $str, $num_char ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment