Created
October 22, 2011 04:00
-
-
Save whyisjake/1305602 to your computer and use it in GitHub Desktop.
Simple function to limit the length of an 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
<?php | |
//To use, just call <?php js_excerpt(Charecters that you want); ?> in your theme. Add this bit here to your functions.php file. | |
function js_excerpt($length){ | |
echo substr(get_the_excerpt(), 0, $length); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment