Code to display product images at same size?

LaDolce-vid-des
Tourist
14 0 2

Is there a way to add code to make all product thumbnails display as the same size on catalog pages? So for example have all photos display as squares in the below screenshot, but then have the original photos still when you click on the product. I'm trying to avoid having to manually crop all of my photos.

 

 

Screen Shot 2021-05-10 at 4.11.01 PM.png

0 Likes
Ninthony
Shopify Partner
1897 285 745

You can rework your code to use background images instead of regular images and then give your container a specified height and width:

https://codepen.io/ninthony/pen/PopPNXd

Or alternatively you can give the images a set width and height with CSS and set the image element's object-fit property to "cover":

https://www.digitalocean.com/community/tutorials/css-cropping-images-object-fit

 

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
LaDolce-vid-des
Tourist
14 0 2

Where in the liquid file would I implement this code?

0 Likes