• Resolved katmacau

    (@katmacau)


    Hello. I have a site where I am having trouble changing the image size on the category pages. Any changes I do are not being applied. They are always coming up as 170 by any height. I want them 236px wide.

    I have tried the following with no luck
    – Setting image size by the customize option. It saves the size there are 236px wide but doesn’t actually apply it.
    – Setting via this in theme:
    add_theme_support( 'woocommerce', array('thumbnail_image_width' => 236));
    Tried this:

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

    Also tried added a new custom size (which worked to generate new images).
    add_filter( ‘subcategory_archive_thumbnail_size’, function( $size ) {
    return ‘vv-category-thumbnails’;
    } );

    No luck there either. Also tried disabling plugins and using different theme (twenty twentyone) but all resulted in images always only being 170px wide.

    I’ve tried resizing with WooCommerce thumbnail resize and also Regenerate thumbnails plugin. No luck. Regne plugin lists my file sizes as:

    Thumbnail Sizes
    
    These are all of the thumbnail sizes that are currently registered:
    
        thumbnail: 200×200 pixels (cropped to fit)
        medium: 400×400 pixels (proportionally resized to fit inside dimensions)
        medium_large: 768×0 pixels (proportionally resized to fit inside dimensions)
        large: 1024×1024 pixels (proportionally resized to fit inside dimensions)
        1536x1536: 1536×1536 pixels (proportionally resized to fit inside dimensions)
        2048x2048: 2048×2048 pixels (proportionally resized to fit inside dimensions)
        vv-category-thumbnails: 236×0 pixels (proportionally resized to fit inside dimensions)
        woocommerce_thumbnail: 170×0 pixels (proportionally resized to fit inside dimensions)
        woocommerce_single: 600×0 pixels (proportionally resized to fit inside dimensions)
        woocommerce_gallery_thumbnail: 100×100 pixels (cropped to fit)
        shop_catalog: 170×0 pixels (proportionally resized to fit inside dimensions)
        shop_single: 600×0 pixels (proportionally resized to fit inside dimensions)
        shop_thumbnail: 100×100 pixels (cropped to fit)

    here is how the images output looks. Possibly lazy loading related?

    <img src="https://myurl.tempurl.host/wp-content/uploads/file-170x170.png" class="attachment-woocommerce_thumbnail size-woocommerce_thumbnail" alt="File" srcset="https://myurl.tempurl.host/wp-content/uploads/file-170x170.png 170w, https://myurl.tempurl.host/wp-content/uploads/file-100x100.png 100w, https://myurl.myurl.host/wp-content/uploads/file-600x600.png 600w, https://myurl.tempurl.host/wp-content/uploads/file-400x400.png 400w, https://myurl.tempurl.host/wp-content/uploads/file-1024x1024.png 1024w, https://myurl.tempurl.host/wp-content/uploads/file-200x200.png 200w, https://myurl.tempurl.host/wp-content/uploads/file-768x768.png 768w, https://myurl.tempurl.host/wp-content/uploads/file-236x236.png 236w, https://myurl.tempurl.host/wp-content/uploads/file.png 1080w" sizes="(max-width: 170px) 100vw, 170px" width="170" height="170">

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Sol J. a11n

    (@solstudioim)

    Hi @katmacau

    Thanks for your question!

    I have a site where I am having trouble changing the image size on the category pages. Any changes I do are not being applied. They are always coming up as 170 by any height. I want them 236px wide.

    You said that you tried adjusting via customizer, theme support, and also using filter, but it still doesn’t work.

    Next Step

    It might be some conflict happening I think.

    So, could you please try to disable all plugins except WooCommerce and switch to Storefront theme temporarily?

    Please try to adjust the image thumbnail through customizer.

    Also this reference should be helpful: https://docs.woocommerce.com/document/image-sizes-theme-developers/

    I hope that helps!

    Let me know how it goes!

    Thread Starter katmacau

    (@katmacau)

    Thank you. I installed storefront and initially the same size issue. But after switching back to my theme it resolved the issue. I think the issue was related to the theme object caching. The 170 size was actually a setting from before we migrated the site. The switch around seemed to flush things out. Thanks.

    Plugin Support abwaita a11n

    (@abwaita)

    Glad to hear it – thanks for letting us know!

    I’ll mark this thread as resolved now. If you have any further questions, you’re welcome to create a new thread.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Thumbnail image not resizing’ is closed to new replies.