Change header on specific page only

Hi, I have already got a custom header (removed search icon and cart icon & changed code) but when i go onto another page the header changes, which is fine because i dont want i the same as it is on my home page however i only want to change the colour and keep the layout.

Please see images attatched.

This is how i want the header layout to be (which it is… on the home page)

This is the header on the product page, as you can see the search icon is back and the colour is not transparent, my main goal is to keep the layout in the first screenshot but change the header to white and text black for all other pages except the homepage

sorry if i dragged this out more than it needed to be.. please help

thanks in advance

Hi!

Your request can be done with JavaScript, but you need to provide more details. Honestly, I didn’t quite understand. Could you briefly explain how the header area should be on the homepage and the remaining pages?

For example:

Homepage header background: black

All other pages header background: transparent, etc.

Terence.

Hey @brandnkay

Go to your theme’s “Edit Code” Option, then in the search bar type “theme.liquid”
Below the tag “” tag paste the following. Screenshot attached for reference.

{% if template.name != 'index' %}
      
{% endif %}

Screenshot is for reference only, the correct code to paste is the one shown above.

Hi, so basically..

Homepage header - transparent with white text

All other pages - white header with black text

On the homepage I need the logo to be white but on all other pages I need the logo to be black.. will I need to use an svg to do this?

Thanks.

Thanks I will give this a go!

Unfortunately this didn’t work - here is what I need…

Homepage header - transparent with white text

All other pages - white header with black text

On the homepage I need the logo to be white but on all other pages I need the logo to be black.. will I need to use an svg to do this?

Thanks.

Can you share a screenshot of how you pasted this? I tested this code myself and it worked exactly the way you described it.

Replace the code with this..

Also take note that in that shila test 2 theme, you have made the default color of the menu black in homepage also.

{% if template.name != 'index' %}
      
{% endif %}

I made the default colour black because it is black on every other page except the home page, I did not know how to only change the colour on one page (homepage)

Ok then leave it as black and paste this code instead.

{% if template.name == 'index' %}
      
{% endif %}

So I used that code and all is the same, sorry for any misunderstanding.

Below i have written exactly what I need

Homepage header - transparent with white text

All other pages - white header with black text

On the homepage I need the logo to be white but on all other pages I need the logo to be black.

Just use the latest one I gave above.

Brilliant. Thats great thanks for your help as always. My apologies for not being so transparent!

Hi, I used this code but the login icon is still black for me and the drop down menus are white against the white background. What would you recommend I do? Sorry for the inconvienance!