I have recently taken over hosting of a website (which was originally designed by EasySpace.com) and the client has asked if I can do some minor alterations. I'm not too clued up on PHP myself but can usually work things out with a bit of guidance.
I am trying to adjust some text on the front page of this website: http://176.32.230.23/internetequestrianproperties.com
The text in question are the "featured properties" listed at the bottom of the page, the title of some of them is too long to fit in the available space and gets cut off. Ideally what I would like to do is, if the length of the title is longer then 24 characters, it would shrink the font size to fit it on two lines, if not, it would show it as it is now.
Could anyone please help me with the code? Here is the code that displays it, line 13 shows the 24 character limit. How can I modify this to shrink the font and wrap onto a second line if the length is over 24 characters?
<h2>Featured Properties For Sale</h2>
<?php $rows = featured_properties() ;
foreach($rows as $row){
$img_id = get_property_image($row['id'], '6');
$im_id = $img_id['0'] ;
if($im_id != ""){
$image_path = "house_img.php?id=".$im_id."&thumb";
}
else{
$image_path = "images/no_image.jpg";
} ?>
<div class="featured">
<h3><a style="text-decoration:none" href="view_property.php?id=<?php echo $row['id'] ?>"><?php echo substr($row['title'],0 , 24); ?></a></h3>
<div class="featured_img"><a href="view_property.php?id=<?php echo $row['id'] ?>"><img src="<?php echo $image_path ?>" width="206" height="138" alt="featured image"/></a></div>
<div class="featured_desc"><p><a style="text-decoration:none" href="view_property.php?id=<?php echo $row['id'] ?>"><?php echo strip_tags(substr($row['description'],0 , 150)) ?>...</a></p></div>
</div>
<?php } ?>
EDIT: I forgot to mention, if you can't see any titles cutting off, refresh the page a couple of times and one of the affected ones should load.