Popular posts

I’ve noticed that the popular post widget actually get the thumbnail in full rather than thumb.

Is there a way to fix this?

Hi @mc9625,

I hope you are well today and thank you for your question.

I have tested it on my test site and it’s working fine for me using latest version of Sparkling theme that the thumbnails of popular post widget are displaying in the size 60 X 60.

If it’s not displaying for you in that size then please try regenerating the thumbnails on your site using the following plugin.

Best Regards,
Movin

Actually I’ve found that the issue is caused by the tab-small size that is not a wordpress default I think (see line 61 in widget-popular-posts.php). Is there a way to change it to “thumbnail” without modifying this file, in order to preserver theme upgradability?

Hi @mc9625,

As said it’s working fine for me using latest version of Sparkling theme.

Have you tried using the plugin as i have suggested?

On line number 61 of the plugin file widget-popular-posts.php the following code is written

echo get_the_post_thumbnail(get_the_ID() , 'tab-small');

which seems correct and uses the small thumbnail size as defined by the following code.

add_image_size( 'tab-small', 60, 60 , true); // Small Thumbnail

Could you please share the page URL from your site where it’s not displaying correctly so that i can troubleshoot it?

Regards,
Movin

Well it works in a brand new wordpress installation, since every media uploaded will be automatically scaled by wordpress, but I would like to apply this theme to a web sites with thousand of images already uploaded. The only way to fix this is to force thumbnail regeneration. But I have a community with hundreds of blogs, each with hundreds (up to many thousands) of images. Force a global thumbnail regeneration could be a huge task.

The easiest way is simply change the “tab-small” to thumbnail, this way the size of images is 150x150 which is a little bit bigger than 60x60 of tab-small, but at least is squared. If you install the theme over a live website wordpress doesn’t know the “tab-small” size, so it will use the “full size” picture. You have to manually regen the thumbnail.

Hi @mc9625,

I understood your issue now.

You can achieve this by using the attached small plugin that contains some custom code to create new widget called “Custom Sparkling Popular Posts Widget”.

Use this widget on your site to achieve the desired result.

Best Regards,
Movin