Skip to content

Instantly share code, notes, and snippets.

@retlehs
Created June 13, 2011 22:16
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save retlehs/1023864 to your computer and use it in GitHub Desktop.
Save retlehs/1023864 to your computer and use it in GitHub Desktop.
truncate WordPress titles (most simple solution)
<?php
/*
* wp_trim_words() was introduced with 3.3.0
*
* @link http://codex.wordpress.org/Function_Reference/wp_trim_words
*/
wp_trim_words(get_the_title());
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment