WordPress.org

Ready to get started?Download WordPress

Forums

Featured Category Widget
[resolved] Thumbnails repeating if no picture on post (3 posts)

  1. agoranet
    Member
    Posted 2 years ago #

    If a post does not have an image within it to use for a thumbnail, the widget is using the picture from the last post that had one. So I end up with pictures that don't go with that post and several of the same thumbnails in a row.

    http://wordpress.org/extend/plugins/category-feature/

  2. agoranet
    Member
    Posted 2 years ago #

    Looks like the variable $cfw_img was not being cleared so when it loops through the posts it uses the previous setting if that variable is not reset with a new thumbnail.

    I got around this by adding this code to CF_WidgetClass.php:
    -----------------------
    else :
    $cfw_img = "";
    -----------------------

    So that block of code looks like this...
    --------------------------------------------------
    if ($cfw_thumb) :
    if ($cfw_width) $cfw_img = '<img title="'.$cfw_image_title.'" src="'.$cfw_thumb.'" alt="'.$cfw_image_alt.'" width="'.$cfw_width.'" height="'.$cfw_height.'" />';
    else $cfw_img = '<img title="'.$cfw_image_title.'" src="'.$cfw_thumb.'" alt="'.$cfw_image_alt.'" style="maxwidth: '.get_option('thumbnail_size_w').'; maxheight: '.get_option('thumbnail_size_h').';" />';

    else :
    $cfw_img = "";
    endif;

  3. tepelstreel
    Member
    Plugin Author

    Posted 2 years ago #

    Good that you mention it. I don't know exactly what has happened here. Actually the plugin was working fine. But obviously I have put a version of the plugin to the repo, that was not fixed yet.

    Cheers again for mentioning.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic