WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. bjallen
    Member
    Posted 4 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 ) {
    array_pop($content);
    }

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

    http://wordpress.org/extend/plugins/content-and-image-teaser/

Topic Closed

This topic has been closed to new replies.

About this Topic