This topic has 6 replies, 2 voices, and was last updated 2 years, 6 months ago ago by Olga Barlow
I want my images to be squared but “non-squared” images look like this
https://i.imgur.com/O75v5md.png
when I want them to uncut, contained like this
https://i.imgur.com/P80aza4.png
But if I use this
https://i.imgur.com/Lodz37t.png
then everything is wrong.
https://i.imgur.com/OQxaLJp.png
Basicaly I just want every image to be squared and contained. Is this possible?
I’m importing images from another xml source, so I can’t crop them.
Hello,
We would recommend you use all the images with the same aspect ratio to get a nice-looking grid. Anyway, I have added some custom CSS to limit product image height. Check now.
Regards
Like I said, I can’t crop the images as they are being imported from few other xml sources.
Your code is nice, but I wanted all images to be squared. I changed the height so it’s better
https://i.imgur.com/odhr0iQ.png
But on larger or smaller displays it’s not squared anymore.
https://i.imgur.com/y5l8WQa.png
https://i.imgur.com/WzFki8A.png
Is it possible to set the height as same value as the width?
also the sale badge is hidden behind the image
https://i.imgur.com/DvktD0r.png
Hello,
If you want to have all the images squared then you need to upload squared images from the very beginning or use crop. There is no other way because the width of the images changes depending on the device width and custom height is static. So, unfortunately. You can try to look for third-party plugins for these purposes but there is no option in the theme to make all the images the same height/width, for example https://wordpress.org/plugins/smart-image-resize/ or similar.
I added below code to child theme style.css to fix the sale label issue
.woocommerce ul.products li.product .onsale, .woocommerce span.onsale {
z-index: 2;
}
Check now.
Regards
thank you!
Hello,
You are welcome.
Regards
Tagged: archive images, best selling, no cut, same height, same width, themes, woocommerce
The issue related to '‘same height and width on all arhive images without being cut’' has been successfully resolved, and the topic is now closed for further responses