• Resolved Kitty

    (@k1t)


    Hi, thanks for this plugin ??
    I’m trying to figure out how to prevent the thumbnail images from cropping, so that they show the whole image proportionally within the thumbnail size.

    I have tried

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

    But this hasn’t changed how the thumbnails display in the gallery.

    Could you please advise how I can change this?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Try this:

    add_filter( 'woocommerce_get_image_size_gallery_thumbnail', 'override_woocommerce_image_size_gallery_thumbnail' );
    function override_woocommerce_image_size_gallery_thumbnail( $size ) {
    // Gallery thumbnails: proportional, max width 200px
    return array(
    'width' => 96,//change width here
    'height' => 150,//change height here
    'crop' => 0,
    );
    }
    
Viewing 1 replies (of 1 total)
  • The topic ‘Prevent thumbnail images from cropping’ is closed to new replies.