• Resolved ginkgogeor

    (@ginkgogeor)


    Hi! I wanted to set a maximum height for a single product image, so that it doesn’t affect the design.

    I tried this CSS it used to work once, but now is not working anymore.
    Any ideas?
    Thank you very much!

    .single.single-product .woocommerce-product-gallery__image.flex-active-slide {
        min-height: 500px;
    }
     
    .single.single-product .woocommerce-product-gallery__image.flex-active-slide a img {
        max-height: 500px;
    }
    • This topic was modified 3 years, 7 months ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Senff

    (@senff)

    Hey @ginkgogeor

    Do you have a link to your site so we can take a look and see what code you might need for this?

    Also, with using the code above, you’ve used both min height and max height. Was that intentional?

    Thread Starter ginkgogeor

    (@ginkgogeor)

    Hi @senff !
    Sure, thank you very much!

    [ redundant link removed ]

    My intention is for this to be square. When I first used this code you could then zoom and see hole image but it was all contained on the square frame. I don’t know what happened that is not working anymore.

    • This reply was modified 3 years, 7 months ago by Jan Dembowski.
    Plugin Support Senff

    (@senff)

    Hey @ginkgogeor

    You may want to check to see if your theme has the option to change the image sizes, which you can find under Appearance → Customize → WooCommerce → Product Images.

    If you don’t have that setting, or it doesn’t do anything, you might want to upload square images for your products to begin with, so you won’t have to manipulate it with CSS.

    As for the code you had before, this only works on products that have more than one image. To use it for all products, replace it with this:

    .single.single-product .woocommerce-product-gallery__image {
        min-height: 500px;
    }
     
    .single.single-product .woocommerce-product-gallery__image a img {
        max-height: 500px;
    }
    Thread Starter ginkgogeor

    (@ginkgogeor)

    Thank you so much!
    I have the setting to customize only width. The thing is that I′m working with dokan on woocommerce, so it′s a multivendor platform, that′s why I wanted to set something so that if someone upload a long picture it fits in the square.

    Unfortunately the CSS is not working.

    Thanks!

    Plugin Support Shohan Hossain Nabil – a11n

    (@sohanhossain)

    Hello @ginkgogeor,

    It’s been a while since you replied back and you might have already found a solution. Let us know if you haven’t yet and I will be happy to take another look.

    Thanks!

    Thread Starter ginkgogeor

    (@ginkgogeor)

    Thank you very much! Issue solved!

    Hi, may I know what is the solution in code?

    Thanks!

    @netguru888

    Kindly open your own thread as this thread as been marked as resolved

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Set maximum height for a single product image’ is closed to new replies.