WordPress post title Limit to 50 characters
How can you create Limit/small characters in your your WordPress loop title.
You cane limit title 50 characters or your need. Its easy.
<?php the_titlesmall('', '...', true, '50') ?>
Ad code your themes functions.php
function the_titlesmall($before = '', $after = '', $echo = true, $length = false) { $title = get_the_title();
if ( $length && is_numeric($length) ) {
$title = substr( $title, 0, $length );
}
if ( strlen($title)> 0 ) {
$title = apply_filters('the_titlesmall', $before . $title . $after, $before, $after);
if ( $echo )
echo $title;
else
return $title;
}
}

ReplyDeleteHello,
we provide affordable and result-oriented SEO services, please give a chance to serve you.
Thanks
Admin: E07.net