Truncate Post Title

Paste this function in your functions.php file, and whenever you’re in need of truncating a title, call: . Where (50) is the number of Characters it allows before truncating!

Code Snippet:

<?php
function customTitle($limit) {
	$title = get_the_title($post->ID);
	$title = substr($title, 0, $limit) . '...';
	echo $title;
}
?>

Posted in Pure hacks