Ready to get started?Download WordPress


WordPress Popular Posts
[Plugin: WordPress Popular Posts] Plugin always resets the featured image to first attachment (2 posts)

  1. kitwestneat
    Posted 2 years ago #

    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.


  2. Héctor Cabrera
    Plugin Author

    Posted 2 years ago #

    Hi there,

    Thanks for reporting this. Will check it out as soon as possible.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic