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