Skip to content

Instantly share code, notes, and snippets.

@whyisjake
Created October 22, 2011 04:00
Show Gist options
  • Save whyisjake/1305602 to your computer and use it in GitHub Desktop.
Save whyisjake/1305602 to your computer and use it in GitHub Desktop.
Simple function to limit the length of an excerpt.
<?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