How do I change the product background colour for all products on my Shopify store?

Topic summary

Goal: Apply a light grey background behind all product images across the store.

Key steps and context:

  • Store URL shared; password provided. Initial access issues resolved via correct link and password entry.
  • Helper advised adding custom code in theme.liquid (before the tag). Note: product images need transparent backgrounds for the effect to show.
  • Merchant added the code (to the second tag) and confirmed it worked on listing pages.

Issues raised:

  • Grey background disappeared on product detail pages and on hover states. Screenshots were provided to illustrate.

Resolution:

  • Due to the broader scope (product pages and hover), collaborator access was requested and granted (via Shopify collaborator code). The helper implemented additional custom code.
  • Merchant confirmed the background is now consistently grey across the site and on hover.

Open item:

  • Merchant asked how to preserve these changes when updating the theme (theme updates can overwrite edited files). No answer yet.

Status: Functionality achieved; guidance on making changes update-safe (e.g., documenting edits, using a duplicate theme or child-like approach) still pending.

Summarized with AI on December 16. AI used: gpt-5.

Good day,

Is there a code for changing the product background colour for all the products on my Shopify store? If so, please share it with the instructions for effecting the said changes. I want the product background to be a light grey colour.

Kind regards

Hi, @Ngadlangadla

Can you please share the store URL so that I can assist you?

Dear AnneLuo,

Thank you, I appreciate your prompt feedback. My Store URL is www.cloudandfire.co.za. The store is password protected at the moment. Will you require the password to assist me?

Kind regards

Dear AnneLuo,

Thank you, I appreciate your prompt feedback. My Store URL is
www.cloudandfire.co.za. It is password protected at the moment. Will you
require the password to assist me?

Kind regards

Yes. Please provide the password so that I can assist you.

Dear AnneLuo,

The password is rtaint7890.

Kind regards,

Mnqobi

I couldn’t find the password entrance. Where is it?

Dear Anneluo,

I apologise for the inconvenience. Please use the following website link, https://cloudandfire.co.za/

Do you want to change it like this?

Dear AnneLuo,

Yes please, that is what I am hoping to achieve. For all products, across all areas on Shopify wherein the product appears.

Kind regards,

Mnqobi

I can help you with it. But implementing this requires adding some custom code. So I need to access your store as a collaborator if possible.

AnneLuo hello, I would appreciate it. How would we be able to accomplish this? Please give me a step-by-step guide and the best way to sort this out.

Dear AnnLuo,

Are you still with me?

Kind regards,

Mnqobi

Hey, @Ngadlangadla

I can’t enter your store now. After I enter the password, it won’t go to the homepage. It still in the password page.

Dear AnneLuo,

Thank you for getting back to me. Please try accessing the store now.

Kind regards,
Mnqobi

You can try this code by following these steps:
Step 1: Go to the online store ->Theme ->Edit Code.
Step 2: Find the theme.liquid file and add the following code before the tag


Note: the background of the product images must be transparent.
Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!

1 Like

Dear Anneluo,

I found the theme.liquid. In the file there are two tags. Should I add the code to the first or second one?

Kind regards,

Mnqobi

Dear AnneLuo,

Thank you it worked. I added to the second tag.

Your help is very much appreciated. Have a good day further.

Kind regards,

Mnqobi

Dear Anneluo,

I just realised that the grey disappears when I enter the product page. I want the code to be maintained even in the product view page. Please help me in this regard.

Kind regards,

Mnqobi

Which part on the product page? Can you take a screenshot to describe?