Trim Text to Any Length in WordPress

The awesome wp_trim_words() function in WordPress lets you trim any content to the length you choose. The second argument is the number of words to trim to.

<?php echo wp_trim_words('Your string', 200); ?>

Adam Walter is a front-end developer, lover of WordPress, and Director of Development at Vital in Portsmouth, NH. Read more about me →