Thumbnails - by Santhatela - on WordPress WooCommerce support

This topic has 6 replies, 2 voices, and was last updated 7 years, 7 months ago ago by Olga Barlow

  • Avatar: identidade
    Santhatela
    Participant
    April 10, 2017 at 10:14

    Hi Olga

    I have a question that is driving me crazy. I use the theme in the default version. My store has 4 columns and I use the images below:
    300×397 for the catalog
    600×795 for product page
    140×185 for gallery thumbs

    In wordpress I disabled the thumbnails, I do not even use …
    But when I add a product it creates images in extra sizes as below:
    220×300
    600×600
    768×488
    So I have twice the images I need …. Double the space and I can not do automatic backup. So my questions are:

    1) Is the theme generating these images and are they necessary for something?
    2) How can I prevent Woocommerce from generating these images?

    Att
    Rudimar

    5 Answers
    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    April 10, 2017 at 17:53

    Hello,

    We are using default WC image options for products. If you get any additional sizes you should contact either WC about this or maybe if you use some additional plugins that have any options for the product images then contact authors of these plugins. We are using default functions for the product sizes.

    Regards

    Avatar: identidade
    Santhatela
    Participant
    April 10, 2017 at 19:15

    Investigating further I discovered that:

    1) The size 600×600 seems to be being generated by adding in theme-init.php the theme file:

    If (! Function_exists (‘etheme_image_sizes’)) {
         Function etheme_image_sizes () {
             Add_image_size (‘shop_catalog_alt’, 600, 600, true);
         }
         Add_action (‘after_setup_theme’, ‘etheme_image_sizes’);
    }

    But I do not know where this image size is being used ….

    2) Size 768 x … is a new size created from version 4.4 of wordpress. It does not appear in the media options, it’s called ‘medium_large’

    3) Size 200×300 is created by the YITH plugin WooCommerce Compare (my size… my bad 🙂 ), I think maybe that using the same size of the gallery (140×185) solves the creation of this extra size.

    I think maybe using the filter below and regenerating thumbnails again would solve the other images.

    / * Custom filter to remove image sizes thumbnails from WordPress * /
    Function remove_default_image_sizes ($ sizes) {

    / * For Default WordPress * /
    Unset ($ sizes [‘medium’]); // Remove Medium resolution (300 x 300 max height 300px)
    Unset ($ sizes [‘medium_large’]); // Remove Medium Large (added in WP 4.4) resolution (768 x 0 infinite height)
    Unset ($ sizes [‘large’]); // Remove Large resolution (1024 x 1024 max height 1024px)

    / * For WooCommerce * /
    Unset ($ sizes [‘shop_catalog_alt’]); // Shop Theme thumbnail (600 x 600)

    Return $ sizes;
    }
    Add_filter (‘intermediate_image_sizes_advanced’, ‘remove_default_image_sizes’);

    Att
    Rudimar

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    April 11, 2017 at 08:24

    Hello,

    etheme_image_sizes function was used for the 2 VC elements Best Offer and Product Looks. But we don’t use it anymore. Seems developers forgot to remove the function from theme-init.php. We’ll do this in next theme update. Size for the compare plugin you can set in plugin settings http://prntscr.com/ev0l1z

    Regards

    Avatar: identidade
    Santhatela
    Participant
    April 11, 2017 at 18:48

    Hi Olga you guys are the best ever.

    Wordpress really create mountains of images almost every time we will never use them.

    I use a cloud server and I only have 4GB on disk and this becomes a big problem.

    The above code did not work so I found a better code and the result was the reduction of about 10 thumbnails for each image to only 4 reducing the disk usage by about 50%

    I used:

    /* Custom filter to remove image sizes thumbnails from WordPress */
    function paulund_remove_default_image_sizes( $sizes) {
    unset( $sizes[‘medium_large’]);
    unset( $sizes[‘medium’]);
    unset( $sizes[‘large’]);
    unset( $sizes[‘shop_catalog_alt’]);
    return $sizes;
    }
    add_filter(‘intermediate_image_sizes_advanced’, ‘paulund_remove_default_image_sizes’);

    With the optimization of the images and some simple tricks (always trying not to use new plugins) I was able to reach 91 score on GTmetrix, even though it was my store with relatively large images.

    Thanks for all and keep pushing

    Rudimar
    PS: You can mark as resolved

    Avatar: Olga Barlow
    Olga Barlow
    Support staff
    April 12, 2017 at 16:51

    Hello,

    Thank you for using our theme!

    Regards

  • Viewing 6 results - 1 through 6 (of 6 total)

The issue related to '‘Thumbnails’' has been successfully resolved, and the topic is now closed for further responses

8theme customization service
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.