Support » Plugin: WordPress Popular Posts » [Plugin: WordPress Popular Posts] Plugin always resets the featured image to first attachment

  • The WPP plugin always resets the featured image to be the first attachment, even if you explicitly set it to be another image. This can be annoying. The problem seems to be in the generate_post_thumbnail function it always update’s the thumbnail id field, even if it is already set. I added this check to the top of the function and it seems to work:

    function generate_post_thumbnail($id, $dimensions, $atts) {
    $img = get_the_post_thumbnail($id, $dimensions, $atts);
    if (!empty($img)) {
    return $img;
    }

    Let me know what you think.

    http://wordpress.org/extend/plugins/wordpress-popular-posts/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WordPress Popular Posts] Plugin always resets the featured image to first attachment’ is closed to new replies.