I need some help customizing how product thumbnails are displayed in the Ride theme.
What I would like to achieve is:
For all product thumbnails across the entire store (collections, featured collection, homepage sections, search results, etc.), I want the first product image to appear with a custom background image behind it.
When a customer opens the product page, all product images should remain normal, with their original transparent backgrounds.
Since your product images are transparent, you can use CSS to add the brick background texture behind them in the thumbnail grids, while keeping the main product page clean.
Go to Online Store > Themes > Edit code. Open Assets/base.css and paste this code at the very bottom:
Hi there! You’re on the right track by wanting to use a background image behind your transparent product photos. The Ride theme doesn’t support this out of the box, but you can add it with a bit of CSS.
Upload your brick texture under Settings → Files and copy the URL.
Open Online Store → Themes → Edit code and locate Assets/base.css (or theme.css if you’ve renamed it). At the very end of the file add:
/* Add a background to product card thumbnails */
.card__media .media {
background-image: url('YOUR_IMAGE_URL');
background-size: cover;
background-position: center;
background-repeat: no-repeat;
}
/* Keep images on the product page transparent */
.product__media-list .media {
background-image: none !important;
background-color: transparent !important;
}
This will apply the brick pattern to all the thumbnail cards across collections, featured collections and search results, but leave the images on the product page untouched.
If you only want the very first image of each product to get the background, you could add a custom class in the product-card snippet that’s only applied to the first media item and target that in your CSS, but for most stores the above code is sufficient.
Once you save and refresh, you should see the thumbnails displaying over your brick background while the full product page still shows the original transparent images. Hope that helps!
Hi, thank you so much, the code works and the background shows up correctly on the product thumbnails.
The only issue is that it also added the background to my collection list (the category cards), and I don’t want the brick texture there.