Hi there!
Sure thing! Add this to your theme’s functions.php file:
<?php
/*
* Customizes the HTML output of the WordPress Popular Posts widget.
*
* @param array $posts
* @param array $options
* @return string
*/
function my_custom_popular_posts_html_list( $posts, $options ){
$output = '<ul class="wpp-list wpp-list-with-thumbnails">';
$counter = 1;
$first_thumbnail_size = array( 300, 125 ); // Change this
$regular_thumbnail_size = array( 90, 77 ); // Change this
// loop the array of popular posts objects
foreach( $posts as $popular ) {
// Thumbnail
$thumbnail = '';
if (
$options['thumbnail']['active']
&& has_post_thumbnail( $popular->id )
) {
if ( 1 == $counter ) {
$thumbnail_src = get_the_post_thumbnail_url( $popular->id, $first_thumbnail_size );
}
else {
$thumbnail_src = get_the_post_thumbnail_url( $popular->id, $regular_thumbnail_size );
}
$thumbnail = "<a href=\"" . get_permalink( $popular->id ) . "\"><img src=\"" . $thumbnail_src . "\" class=\"wpp-thumbnail wpp_cached_thumb wpp_featured\" alt=\"" . esc_attr( $popular->title ) . "\"></a>";
}
$output .= "<li>";
$output .= $thumbnail;
$output .= "<a href=\"" . get_permalink( $popular->id ) . "\" title=\"" . esc_attr( $popular->title ) . "\" class=\"wpp-post-title\">" . $popular->title . "</a>";
$output .= "</li>" . "\n";
$counter++;
}
$output .= '</ul>';
return $output;
}
add_filter( 'wpp_custom_html', 'my_custom_popular_posts_html_list', 10, 2 );
Feel free to tweak it to your own needs ??