“Top Posts” Widget (Jetpack), image cropping
-
Hi,
I’m using the Jetpack “top posts” widget.
In the last couple days, it has stopped cropping images to thumbnails, and is instead re-sizing.
Any fix?
Thanks!
(url: http://www.bayview-news.com)
….just realized this should be in jetpack forum, sorry.
-
I believe you’re running into this issue:
https://github.com/Automattic/jetpack/pull/6140Until the problem is fixed in the next version of Jetpack, could you try to add the following to your theme’s functions.php file, or in a functionality plugin? That should solve the issue.
/** * Resize all Top Posts Images to 40x40px * * @param array $image_options Array of Image options. */ function jeherve_top_posts_images_size( $image_options ) { $image_options['avatar_size'] = 40; return $image_options; }Sorry for the trouble!
Thank you!!! 🙂
I’m not that comfortable with editing PHP, so wish me luck! 😉
The functionality plugin I linked to above should make it a bit easier:
- install and activate the plugin.
- go to the new menu it created.
- Create a new snippet.
- Paste the code I posted above.
- Save and activate the snippet.
That should be it!
i followed your directions… didn’t work? :-/
http://www.bayview-news.com/wp-content/uploads/2017/01/code-snippet.jpg
Oh, I’m sorry, I forgot to paste one line of my code snippet! Try with this instead:
/** * Resize all Top Posts Images to 40x40px * * @param array $image_options Array of Image options. */ function jeherve_top_posts_images_size( $image_options ) { $image_options['avatar_size'] = 40; return $image_options; } add_filter( 'jetpack_top_posts_widget_image_options', 'jeherve_top_posts_images_size' );That worked! THANK YOU!!!
The topic ‘“Top Posts” Widget (Jetpack), image cropping’ is closed to new replies.