getdave / Tanlinell

Boilerplate Wordpress theme for rapid development of new WP themes. Based on the great work of the _s ("Underscore") theme.
GNU General Public License v2.0
6 stars 2 forks source link

Update old content truncation function #97

Closed getdave closed 11 years ago

getdave commented 11 years ago

There is a function in helpers to truncate the the_content(). It isn't particularly good and often does things like cut off mid-word and does not account for situations where it might accidentally break HTMK markup by trimming strings.

A better solution is

<?php echo balanceTags(wp_trim_words( get_the_content(), $num_words = 20, $more = "..." ), true); ?>

Please implement, test and remove old function.

neilberry001 commented 11 years ago

Closed via bc6482c863222e2830236d65eee8b7cf81e73e24