Thumbnail image not resizing
-
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">
The topic ‘Thumbnail image not resizing’ is closed to new replies.