[Plugin: Content and Image Teaser] Truncates Last Word If Content is Shorter than the Limit (1 post)

  1. bjallen
    Posted 6 years ago #

    In using this plugin I've found that the last word is truncated if the content is shorter than the number of words passed as an argument. The array_pop call near line 54 of the plugin file should only be called if the content has been truncated (i.e. is longer than the allowed number of words). The condition below seems to fix the problem.

    if ( sizeof($content) == $limit ) {

    This is probably somewhat of an edge case since most posts will be longer than your excerpt allows. Overall a very helpful plugin.


Topic Closed

This topic has been closed to new replies.

About this Topic