Posted By

dloop on 11/15/11


Tagged


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

shaifshahin
zemonte


Wordpress: Display Post Titles With a Custom Length


 / Published in: PHP
 

  1. Add to functions.php:
  2.  
  3. function ODD_title($char) {
  4. $title = get_the_title($post->ID);
  5. $title = substr($title,0,$char);
  6. echo $title;
  7. }
  8.  
  9.  
  10.  
  11. insert into template:
  12.  
  13. <?php ODD_title(20); ?>

Report this snippet  

You need to login to post a comment.