Return to Snippet

Revision: 53146
at November 15, 2011 02:39 by dloop


Updated Code
Add to functions.php:

function ODD_title($char) {
         $title = get_the_title($post->ID);
         $title = substr($title,0,$char);
         echo $title;
}



insert into template:

<?php ODD_title(20); ?>

Revision: 53145
at November 15, 2011 02:38 by dloop


Initial Code
Add to functions.php:
function ODD_title($char) {
         $title = get_the_title($post->ID);
         $title = substr($title,0,$char);
         echo $title;
}




insert into template:
<?php ODD_title(20); ?>

Initial URL


Initial Description


Initial Title
Wordpress: Display Post Titles With a Custom Length

Initial Tags


Initial Language
PHP