Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1040036

    I wish there was a way to set the gallery-thumbnail images in Appearance>customize>woocommerce images, but there isn’t. My gallery-thumbnail images are blurry and set to 36×36 pixels, don’t know how this happened, and I see the solution is to add the following into the functions code:

    add_filter( ‘woocommerce_get_image_size_gallery_thumbnail’, function( $size ) {
    $size[‘width’] = 300;
    $size[‘height’] = 300;
    $size[‘crop’] = 1;
    return $size;
    }, 10, 1);

    I was going to do that but change the width to 100 and the height to 75 so it will have the same ratio as my other images in Woocommerce. Only problem is that in my functions is the following and I’m not sure what that is or if it will override the above code:

    global $woocommerce;

    if (version_compare($woocommerce->version, ‘3.0.0’, “>=” )) {

    add_theme_support( ‘wc-product-gallery-zoom’ );
    add_theme_support( ‘wc-product-gallery-lightbox’ );

    function avia_woocommerce_gallery_thumbnail_description($img, $attachment_id, $post_id, $image_class ) {
    return $img;
    }
    function avia_woocommerce_post_thumbnail_description($img, $post_id){
    return $img;
    }

    Should I put the code above that or delete that? I’m afraid to try it in case it messes up my website at this time.
    Thanks!
    PS. I got a response that you wanted me to open a new thread and give admin login for you to have a closer look.

    #1040824

    Hey lisetyrrell,

    Can you point to us the page and image that you’d like to change the image dimension?
    And what image width and height you’d like to use.
    As for the 2nd code you posted the one that contains:

    if (version_compare($woocommerce->version, ‘3.0.0’, “>=” )) {

    there should be no need for that on Enfold 4.5

    Best regards,
    Nikko

    #1040852

    Thanks for letting me know that I don’t need that code anymore.

    As for the images I want to change. If you go to the home page: https://takeasmoke.com/ and look on the right under Customers top rated products, you’ll notice the images are blurry. When I use inspect element I see that they are 36 pixels by 36 pixels. Since all the images are landscape, I think it would look better if they were 100 pixels wide by 75 pixels high. Hopefully that would do away with the blurriness.

    Bottom line, I want to do away with the blurriness. I’m not sure what update caused them to be blurry and changed the size but they didn’t use to be blurry.

    If I add the below to the functions code, do you think that will fix it?

    add_filter( ‘woocommerce_get_image_size_gallery_thumbnail’, function( $size ) {
    $size[‘width’] = 100;
    $size[‘height’] = 75;
    $size[‘crop’] = 1;
    return $size;
    }, 10, 1);

    Thanks,
    Lise

    #1041647

    Hi Lise,

    I think that won’t work, I looked for 36px by 36px image sizes and found out that it was “widget” image size.
    Try adding this code at the bottom of functions.php:

    add_filter( 'avf_modify_thumb_size', 'enfold_customization_modify_thumb_size', 10, 1 );
    function enfold_customization_modify_thumb_size( $size ) {
      $size['widget'] = array('width'=>100, 'height'=>75);
      return $size;
    }

    after adding this code, try to re-upload your image.

    Best regards,
    Nikko

    #1042186

    Thank you! The only problem is that the blurry images apply to all product images,and there are a lot of them. Can’t I just regenerate thumbnails after putting in the above code or do I really have to upload all images again?

    Thanks!

    #1043157

    Hi lisetyrrell,

    You can modify the code and install some image regeneration plugin, you should find lots of plugins that does it. :)

    Best regards,
    Nikko

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.