How to change the size of the thumbnails in the Top Posts widget

The Top Posts widget offers different options to display a list of posts, or a grid of post thumbnails. In some cases, you might want to change the size of the thumbnails used by this widget.

To do so, you’ll need to change the size parameters in the image source, by adding the following code to your theme’s functions.php file, or to a functionality plugin:

function jeherve_custom_thumb_size( $get_image_options ) {
        $get_image_options['avatar_size'] = 600;

        return $get_image_options;
}
add_filter( 'jetpack_top_posts_widget_image_options', 'jeherve_custom_thumb_size' );

You can add some custom CSS to overwrite Jetpack’s default CSS. You can paste this CSS in yor theme’s stylesheet, or under Appearance > Edit CSS in your dashboard:

#widget_top-posts .widgets-list-layout-blavatar {
    max-width: 600px;
}
This entry was posted in Code snippets, Tips & Tricks and tagged , . Bookmark the permalink.
  • Recent Comments

    Jeremy on Jetpack 4.2.2: Facebook Sharin…
    Jeremy on Get People to Stay on Your Web…
    Jeremy on Get People to Stay on Your Web…
    Dave Z on Get People to Stay on Your Web…
    Destination Infinity on Get People to Stay on Your Web…
  • Archives

  • Enter your email address to follow this blog and receive notifications of new posts by email.

  • Install Jetpack to see our line-up of features.

    Install Jetpack Now

    Don’t need all Jetpack’s features? No problem. Only activate what you need!

    Follow

    Get every new post delivered to your Inbox.

    Join 56,542 other followers

    %d bloggers like this: