only append ellipsis in limit_words when string was actually limited
This commit is contained in:
parent
6acc979655
commit
f665564a79
@ -342,7 +342,9 @@ class Pico {
|
|||||||
private function limit_words($string, $word_limit)
|
private function limit_words($string, $word_limit)
|
||||||
{
|
{
|
||||||
$words = explode(' ',$string);
|
$words = explode(' ',$string);
|
||||||
return trim(implode(' ', array_splice($words, 0, $word_limit))) .'...';
|
$excerpt = trim(implode(' ', array_splice($words, 0, $word_limit)));
|
||||||
|
if(count($words) > $word_limit) $excerpt .= '…';
|
||||||
|
return $excerpt;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user