Resizing thumbnails in WooCommerce

After the next update of WooCommerce, not all thumbnail sizes can be changed through the WordPress admin panel. It used to be like this:

thumbnail resizing woocommerce

Now the settings are moved to the menu item "Appearance -> Customize"

thumbnail cropping woocommerce

And now there is no such flexibility of settings as before. The necessary settings can now be made only with the help of the code:

-for catalog image

function add_thumbnail_size($size){

    $size['width'] = 300;
    $size['height'] = 300;
    $size['crop']   = 1; //0 - full, 1 - crop
    return $size;

- for the image on the product page

function add_single_size($size){

    $size['width'] = 600;
    $size['height'] = 600;
    $size['crop']   = 0;
    return $size;

- for miniatures in the product gallery

function add_gallery_thumbnail_size($size){

    $size['width'] = 100;
    $size['height'] = 100;
    $size['crop']   = 1;
    return $size;

To recreate the thumbnails, you can use the plugin Force Regenerate Thumbnails .

Updated: 18.11.2018

Did this article help you? Rate it!
(3 votes, average: 3.67 out of 5)

Leave a Reply

Your email address will not be published. Required fields are marked *


Send message