Shopify themes, liquid, logos, and UX
Hi everyone,
I have made my first store in the Shopify Dawn theme, although there is something I can't figure out.
On the PDP (product detail page) the first image and the last image (only if I have an odd number of images on the PDP) is very large.
Does someone know how I can edit that to make all images the same size?
Thanks!
In the file /snippets/product-thumbnail.liquid you can look for something like this:
<div class="product__media media" style="padding-top: {{ 1 | divided_by: media.preview_image.aspect_ratio | times: 100 }}%;">
And replace the media.preview_image.aspect_ratio with the aspect ratio you want.
For example, if you want images to be square, just go with 1 (so the padding-top is 100% and you have a square image).
Then on the lines below that, find img_url and change them to be square (e.g. img_url: '500x500').
If you want to crop the image, you can do something like img_url: '500x500', crop: 'center'.
More info about the img_url filter here.
User | RANK |
---|---|
186 | |
168 | |
78 | |
56 | |
45 |
Transform this holiday season into a shopping spree. Plus, learn how to effortlessly open ...
By Jasonh Dec 8, 2023Make the shift from discounts to donations, and witness your business not only thrive fina...
By Holly Dec 4, 2023On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023