Custom WordPress Title Length


/ Published in: PHP
Save to your folder(s)

Must be used in the loop.


Copy this code and paste it in your HTML
  1. // Replace 34 with the number of characters to display.
  2.  
  3. <?php
  4. $title = the_title('','',FALSE);
  5. echo substr($title, 0,34);
  6. if (strlen($title) > 34) echo "...";
  7. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.