fbpx
Want To Add Extra Images Per Product Variation For Free? Download Now

Display existing thumbnail ratio

Joseph Flores

Currently all thumbnails are square even if the original thumbnails are not a 1:1 ratio.  How do you keep the thumbnaisl their original image ratio?  Right now the only option I see in settings is Thumbnail width which automatically forces both the height and width to that width setting… thus making it square.

Golam Kibria

Hi Joseph,

Please try adding the following snippet to your child theme’s functions.php file

add_filter( 'woocommerce_get_image_size_gallery_thumbnail', function( $size ) {
return array(
'width' => 150,
'height' => 150,
'crop' => 0,
);
} );

Change the values of height and width to get your desired ratio.

Let me know if this helps.

Thank You

Joseph Flores

That might resize the thumbnails to an entirely different dimension.. but if the thumbnails by default are not the same dimensions.. some are 1:1.. others 5:6.. is there a setting to get the thumbnail to stick to the dynamic ratio of the image itself?

Golam Kibria

Hi Joseph,

Unfortunately, this feature is not currently available.

Please add a feature request here: https://storepress.fider.io/

Thank You