Hi there!
Sorry for the late reply. Last week was been a hectic one.
No, currently there is no configurable option to have a specific widget use a different thumbnail source.
Here’s a workaround:
- Go to Settings > WordPress Popular Posts > Tools.
- Under Thumbnails, set Pick image from to First image on post and hit the Apply button below to shave changes.
- Add the following code to your theme’s functions.php file:
<?php
function my_custom_single_popular_post( $post_html, $p, $instance ){
if (
isset( $instance['widget_id'] )
&& 'wpp-7' == $instance['widget_id'] /* CHANGE THIS ID TO YOUR OWN! */
) {
$post_thumbnail = get_the_post_thumbnail( $p->id, array(75, 75), array('class' => 'wpp-thumbnail featured-image') );
$post_permalink = get_the_permalink( $p->id );
$output = '<li>' . $post_thumbnail . '<a href="' . $post_permalink . '" title="' . esc_attr( $p->title ) . '">' . $p->title . '</a></li>';
return $output;
}
// ELSE
// Return original output
return $post_html;
}
add_filter( 'wpp_post', 'my_custom_single_popular_post', 10, 3 );
?>
- From the code above, you’ll need to change the ‘wpp-7’ ID string in the IF statement to the one WordPress assigned to your WPP widget on your site. You can see this ID string by inspecting the HTML code on your site or you could just add
var_dump( $instance['widget_id'] );
at the beginning of the function to see it on your site.
- Tweak the code further according to your needs.
Thanks for the reply. The workaround works fine for me. I’ll mark as resolved