Limit the number of characters displayed in title


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



Copy this code and paste it in your HTML
  1. <?php $title = the_title('','',FALSE); echo substr($title, 0, 20); if (strlen($title) >20){ echo '&hellip;'; } ?>

URL: http://www.wpcult.com/limit-the-characters-that-display-on-the_title/

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.