Change the Home page font colour only

Solved
Highlighted
New Member
5 0 0

Hi there,

I am pretty new to using the coding side of Shopify and was wondering if someone may be able to help me with the following:

I am wanting to change the main font colour of only the Home Page body text and leave the other pages body text colour the same, is there an easy work around in the coding to be able to do this?

Thanks for the help.

0 Likes
Highlighted
Shopify Partner
591 84 127

This is an accepted solution.

Please place this code between <head></head> in theme.liquid

<style>
{% if template.name == "index" %}
body {
color: //whatever you want; 
background-color: //whatever you want;
} 
{% endif %}
</style>




If this solution works, then please accept it as solution and like.
For theme customization, please contact parambabla.soft@gmail.com
0 Likes
Highlighted
New Member
5 0 0

Hi Paramsoft, 

 

Thanks for the message, I have tried this however it doesn't seem to be working. To confirm, is this only to change the home body text and nothing else?

0 Likes
Highlighted
Shopify Partner
591 84 127

Yes, it is for homepage only. Please provide website URL so that I can check

If this solution works, then please accept it as solution and like.
For theme customization, please contact parambabla.soft@gmail.com
0 Likes
Highlighted
New Member
5 0 0

Hi Paramsoft, 

 

Just tried it again and it worked for the Headings, how can I now change the body text only on the home page?

 

Thanks!

0 Likes
Highlighted
Shopify Partner
591 84 127
<style>
{% if template.name == "index" %}
body {
color: //whatever you want; 
background-color: //whatever you want;
 // add this line
font-family: //whatever font family you want;
} 
{% endif %}
</style>
If this solution works, then please accept it as solution and like.
For theme customization, please contact parambabla.soft@gmail.com
0 Likes