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:
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:
Solution provided:
theme.liquid file that targets only product pages using {%- if template == "product" -%}</head> tag to change header color specifically when on product template pagesFollow-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.
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:
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 Editor → Edit Code → theme. 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.
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 ![]()
Sorry maybe i was not clear enough ![]()
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 -%}
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 ![]()
@Charmeclothing , change the previous code i sent you like this
{%- if template == "product" -%}
{%- endif -%}
Result: