Skip to content

Instantly share code, notes, and snippets.

@zogot
Created May 13, 2013 06:55
Show Gist options
  • Save zogot/5566583 to your computer and use it in GitHub Desktop.
Save zogot/5566583 to your computer and use it in GitHub Desktop.
Limit WordPress content by words.
<?php // where 15 is the word limit ?>
<?php echo apply_filters( 'the_content', wp_trim_words( get_the_content(), 15, '&hellip;' ) ); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment