2014-10-21, 10:28:51
Hi johnstray2001,
When a post has less characters than excerpt length, the excerpt isn't displaying the last word of the post. To display it complete, need to add at least two spaces at the end.
This can be fixed in the show_blog_post function like this:
Maybe there's a better way to do it but this one works for me
Regards
When a post has less characters than excerpt length, the excerpt isn't displaying the last word of the post. To display it complete, need to add at least two spaces at the end.
This can be fixed in the show_blog_post function like this:
PHP Code:
# Determine if we should be showing an excerpt or full post.
$el = (empty($blogSettings['excerptlength']) ? 250 : $blogSettings['excerptlength']); // Excerpt length?
$tc = strlen(html_entity_decode($post->content)); // Total characters of the post
if(($excerpt == false) || (($excerpt == true) && ($blogSettings['postformat'] == 'Y')) || ($tc <= $el)) {
$p['content'] = html_entity_decode($post->content); // Get the full contents of the post
} elseif(($excerpt == true) && ($blogSettings['postformat'] == 'N')) { // It's an excerpt...
$p['content'] = $Blog->create_excerpt(html_entity_decode($post->content),0,$el); // Create excerpt
} else {echo 'Uh oh! Something went wrong!';}
Maybe there's a better way to do it but this one works for me
Regards
English isn't my native language. Sorry for any mistakes you may find.