Jump to content

Hiding additional images in product gallery

Recommended Posts

Site URL: https://www.craftsplosion.net/stock-items/p/5gpr2lwfbnldwgh1vgqc8vz2y8slf8

Does anyone know how to hide or remove additional images from a product gallery?  For example, in the wine glasses page I linked, I want to remove the 2nd (lower quality gif) and 4th (image with text and logo) images from the gallery on the product details page.  However, I want to leave them in the product editor since I'm using the gif as the alt image on hover for the thumbnail and the text/logo image for product variants.  Any help would be greatly appreciated!  Thanks!

Link to comment

Try edit product > Additional Info > Add Code Block > paste this code

<style>
  /* image 1 is nth-child(3), image 2 is nth-child(4)... */ 
  .ProductItem-gallery-slides>div:nth-child(4), .ProductItem-gallery-slides>div:nth-child(6) {
    display: none !important;
}
</style>

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Thanks a ton, Tuan!  Turns out I can't use the text/logo image at all if it's hidden, so I deleted that part of the code out.  It's definitely an improvement just having that lower quality gif out of the gallery, though.  The only issue is that instead of displaying the gif, it displays a completely blank image.  The gif appears normally as the alt image for the thumbnail; it's just in the gallery that it displays as blank.  Do you think there'd be a way to remove that blank image entirely?  If there isn't a way, do you think it could be replaced with a different image (for example, our logo or a message)?

Thanks again!

Link to comment
  • 6 months later...
7 minutes ago, zala said:

Hi @tuanphan I have the same question but the code provided didn't do anything for me.

I want to keep the hover effect on the thumbnail, but I don't want the 2nd image to show on the products page because it pushes the Additional Info down too far. 

https://www.downtoearthadventures.com/adventures/wild-swimming

pw: downtoshirts

 

Thank you!

You mean hide top or bottom image?

image.thumb.png.c6af608744fae8ba2876970a5e866e78.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment

Hi @tuanphan, any luck with this? I've deleted the 2nd product image on the site in order to fix the spacing on the product page, but I'd love to keep the hover effect that the 2nd image creates on the thumbnail. 

Downtoearthadventures.com

Thanks!

Link to comment
10 hours ago, zala said:

Hi @tuanphan, any luck with this? I've deleted the 2nd product image on the site in order to fix the spacing on the product page, but I'd love to keep the hover effect that the 2nd image creates on the thumbnail. 

Downtoearthadventures.com

Thanks!

Add image 2, then add this to Design > Custom CSS

/* Hide bottom image */
.ProductItem-gallery-slides>div:nth-child(n+2) {
    display: none !important;
}

 

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 1 year later...
  • 1 month later...

Hi @tuanphan I can see that the code you've provided for the original query targets additional images which is what I too am after, but what do I add to the code instead of 'display: none', to make the sidebar of additional images larger, as it currently shows half of them with a scroll bar and makes my site look tacky. I've tried adding (width: 100%) coding in, but it isn't altering anything even when adding !important.

 

So any width code i can mess with would be great thank you!

Link to comment
14 hours ago, jksnmedia said:

Hi @tuanphan I can see that the code you've provided for the original query targets additional images which is what I too am after, but what do I add to the code instead of 'display: none', to make the sidebar of additional images larger, as it currently shows half of them with a scroll bar and makes my site look tacky. I've tried adding (width: 100%) coding in, but it isn't altering anything even when adding !important.

 

So any width code i can mess with would be great thank you!

Can you share link to a product?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Link to comment
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.