Alright, so I installed FIFU on my test site and played around with it for a bit. According to your comments FIFU used to play along with WPP but now it doesn’t anymore so my guess is that something changed recently on FIFU’s side that broke compatibility between the two plugins.
As a workaround to get your popular posts thumbnails to render again please follow these instructions:
#1 Go to Plugins > Plugin File Editor and select the WordPress Popular Posts plugin.
#2 Click on src > Image.php to edit this file.
#3 Replace the contents of the Image.php file with this version.
#4 Click on the Update File button to save changes.
#5 Add the following code snippet to your theme’s functions.php file (or via the Code Snippets plugin for example):
/**
* Replaces WordPress Popular Posts' thumbnails with
* the stock post thumbnail (FIFU plugin compatibility patch).
*
* @param string $img_tag The original thumbnail image tag as generated by WPP
* @param int $post_id The post / page ID.
* @return string The (modified) thumbnail image tag.
*/
add_filter( 'wpp_render_image', function($img_tag, $post_id) {
$featured_image = get_the_post_thumbnail($post_id, array(320, 420));
if ( $featured_image ) {
return $featured_image;
}
return $img_tag;
}, 10, 2);
The only thing that you may want to adjust in that code snippet is the thumbnail size. Change array(320, 420)
to your desired width/height combo.
-
This reply was modified 1 year, 3 months ago by Hector Cabrera. Reason: Fixed typo