Change colour of a single page instead of the whole theme

Hello I really need help changing the background colour of a single page on my website. I think it is a coding issue which I have no clue how to do :see_no_evil_monkey:

Yellow - Pantone: ffd000

Please help me :disappointed_face:

https://www.livelovesoca.com/pages/pace

Hi @Stefanpaullls

  • I understand your concern. I checked the link and I came to know that there is no unique class applied on body tag

    • Please check the attached screenshot:

  • First of all, you have to add a β€˜page-{{ page.title }}’ class to your body tag. Due to this, you can get a unique class for each page

    • Please check the attached screenshot:

In the second step, you have to add the below code to the theme.css file.

.page-Pace {
    background-color: #ffd000;
}

Please check the attached screenshot:

I hope this can help you to resolve the issue.

Hello, thank you for your help. I tried your method but it didnt work unfortunately. Also now all the links on my website does not click. Have i messed it up. If so what do you think i did wrong?

Hi @Stefanpaullls

I helped to resolve the issue. Now, we can add conditions to the body tag. So it’s added class only when the template is page.

  • First all of all, replaced the code by {%- if template == β€˜page’ -%} page-{{ page.title | downcase }} {%- endif -%} from theme.liquid

    • Please check the attached screenshot:

In the second step, you have to replaced the code of the theme.css file.

.page-pace {
    background-color: #ffd000;
}

I hope this can help you to resolve the issue.