Sono riuscito a raccimolare in rete questa funziona, che però non some dove inserirla, in che punto del documento...
Codice PHP:function truncate_text($text, $words = 40)
{
$exp = explode(' ', $text);
$pieces = array_chunk($exp, $words);
$new_text = implode(' ', $pieces);
return $new_text;
}

Rispondi quotando