Webmastersite.net
Register Log In

Limiting title characters the hard way

Title Limiting title characters the hard way
Message Text I have set the limit for characters to be used in a title to 30. That works fine as long as users are actually typing it, but since I get a lot of submissions with titles MUCH longer than that there must be a way around it. I managed to do it by pasting longer titles in the form as well as using the META tag button. Unlike the textarea field for the description the input field for the title doesn't seem to cut back the characters that are over the limit automatically once you click on the field. So I was thinking I could limit the title output instead. It might not be pretty in some cases, but people will get the point and maybe edit their titles to make them shorter. I tried something like this, but it's been either producing errors or returning a blank title:
<?php
global $title;
$titlenew = substr($title, 0, 30); 
?>

<?php echo $titlenew; ?>
Rating
  • 0/5
  • 1
  • 2
  • 3
  • 4
  • 5
0/5 based on 0 votes.
Ownership Jenny
Views 258 views. Averaging 0 views per day.
Similar Topics
Submission Date Jun 19, 2010 - 4:18 AM