You are viewing an old revision of this post, from March 17, 2014 @ 12:55:46. See below for differences between this version and the current revision.

Trim Your Text with wp_trim_words() in WordPress

Today, I discovered that WordPress 3.3 actually has a similar core function called wp_trim_words(). The function works like so: [php]<?php wp_trim_words( $text, $num_words = 55, $more = null ); ?>[/php]   [php] php echo wp_trim_words( get_the_content(), 100, '...' );[/php]

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

Revision Differences

There are no differences between the March 17, 2014 @ 12:55:46 revision and the current revision. (Maybe only post meta information was changed.)

Tags: ,

No comments yet.

Leave a Reply