only append ellipsis in limit_words when string was actually limited
This commit is contained in:
parent
6acc979655
commit
f665564a79
1 changed files with 3 additions and 1 deletions
|
@ -342,7 +342,9 @@ class Pico {
|
|||
private function limit_words($string, $word_limit)
|
||||
{
|
||||
$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…
Add table
Reference in a new issue