How to change the heading text color, in only the all products page.

Topic summary

A user wants to change the header text color specifically on product pages without affecting other pages. Initially, there was confusion about whether they meant page headings or the header menu.

Clarification:

  • The user wants the header menu (top navigation) to be black on product pages and white on the home page.

Solution provided:

  • Add conditional code to theme.liquid file that targets only product pages using {%- if template == "product" -%}
  • Insert custom CSS above </head> tag to change header color specifically when on product template pages

Follow-up request:
The user also wants to display a different logo on product pages. A support member requested the alternative logo link and provided updated code to implement both the color change and logo swap simultaneously.

Status: Resolved - the header color change worked successfully, and code for the logo swap was provided.

Summarized with AI on November 4. AI used: claude-sonnet-4-5-20250929.

Hi i was wondering how i could change the heading color in one page only, so it doesnt effect the other heading text colors on other pages.

This is the page i want to change:

https://aa1250-cc.myshopify.com

Hi @Charmeclothing

You can achieve this by adding a unique class to the body tag of the product’s single page.

To do that, go to Theme EditorEdit Codetheme. liquid.

Then, find the tag. If the body tag already contains a class, add this Liquid code after that class:

{% if template == 'product' %}product-page{% endif %}

This will add a unique class to the body tag of the product single page, allowing you to use it as a parent selector to change the color of that specific heading only.

@Charmeclothing ,

Step 1: Go to Shopify Admin → Online Store ->Theme → Edit code

Step 2: Search file theme.liquid

Step 3: Insert this code above

{%- if template == "product" -%}

{%- endif -%}

Result:

If it helps you, please like and mark it as the solution.

Best Regards :blush:

Sorry maybe i was not clear enough :slightly_smiling_face:

I meant like the header menu on the top i want it to be black on the product page and to be white on the home page.

@Charmeclothing , ok change the code like this

{%- if template == "product" -%}

{%- endif -%}
1 Like

Thank you so much it worked last question how can i change the logo so it becomes another logo on that page?

@Charmeclothing , could you share me the link to your another logo? I will send you the code

Yes of course, here you go :slightly_smiling_face:

https://cdn.shopify.com/s/files/1/0901/9798/3573/files/Etoile_Elegante-4-removebg-preview_1.png?v=1727802663

@Charmeclothing , change the previous code i sent you like this

{%- if template == "product" -%}

{%- endif -%}

Result:

1 Like