apply_filters ( 'jetpack_top_posts_widget_image_options', array $get_image_options )

Top Posts Widget Image options.

Source file: modules/widgets/top-posts.php

View in GitHub

Parameters

$get_image_options

(array) { Array of Image options.


Changelog

Since: Jetpack 1.8.0


Notes

You can use this filter to change the size of the images displayed in the Top Posts Widget. In the example below, we’ll change the size to 600px.

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’ll also need some CSS to make sure the size is correct on all devices:

.widget_top-posts .widgets-list-layout li > a {
    width: 40%;
} 
 
.widget_top-posts .widgets-list-layout img.widgets-list-layout-blavatar {
    max-width: 240px;
    width: 100%;
}
 
.widget_top-posts .widgets-list-layout div.widgets-list-layout-links {
    max-width: 100%;
    width: 55%;
}
 
@media only screen and (max-width: 1019px) {
 
    .widget_top-posts ul.widgets-list-layout {
        max-width: 600px;
        margin: 0 auto;
    } 
 
    .widget_top-posts .widgets-list-layout div.widgets-list-layout-links {
        font-size: 24px;
    }
}

Have a note to contribute?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s