Code Length:222 / Preview Limit: 230 dedot[<code></code>] function max_title_length( $title ) { $max = 14; if( strlen( $title ) > $max ) { return substr( $title, 0, $max ). " …"; } else { return $title; } } add_filter( 'the_title', 'max_title_length');

WordPress Short Title Length

Written by

How to short the_title() in #WordPress

#1st – 2011 / last evo – 2012 …soon!
- 0 Comments [ little preview ]
function max_title_length( $title ) {
$max = 14;
if( strlen( $title ) > $max ) {
  return substr( $title, 0, $max ). " …";
  } else {
    return $title;
    }
}
add_filter( 'the_title', 'max_title_length');