Today, I discovered that WordPress 3.3 actually has a similar core function called wp_trim_words().
The function works like so:
<?php wp_trim_words( $text, $num_words = 55, $more = null ); ?>
php echo wp_trim_words( get_the_content(), 100, '...' );
Revisions
- March 17, 2014 @ 12:55:46 [Current Revision] by PeterLugg
- March 17, 2014 @ 12:55:46 by PeterLugg
- March 17, 2014 @ 12:55:24 by PeterLugg
No comments yet.