I need to limit characters in a text, and should stick with (...). The title goes out of the layout.
if($related){
echo '
<div class="row">
<div class="medium-12 columns">
<div class="ap-ads-related">
<h2>Anúncios Relacionados</h2>
<div class="row">
';
foreach ($related as $key => $rel) {
$related_images = $this->ads_model->images($rel->ad_id);
$related_image = thumbnail(@$related_images[0]->ads_img_file, "ads", 260, 180, 2);
echo '
<div class="small-6 medium-3 end columns">
<a href="'.base_url('anuncio/'.$rel->ad_slug).'" title="'.$rel->ad_name.'" class="item">
<div class="image"><img alt="'.$rel->ad_name.'" src="'.$related_image.'"></div>
<h4>'.$rel->ad_name.'</h4>
<div class="price">'.(($rel->ad_service) ? 'Serviço' : string_money($rel->ad_price)).'</div>
</a>
</div>
';
}
echo '
</div>
</div>
</div>
</div>
';
}
?>