How do I create a specific class to the <body> tag on my home page? (DAWN theme)

Topic summary

A user working with Shopify’s Dawn theme wants to add a custom class (e.g., “home-page”) to the <body> tag specifically on their homepage.

Proposed Solution:

  • Navigate to Theme → Edit code → theme.liquid file
  • Locate the <body> tag line
  • Add the desired class directly to the tag

Implementation Context:
The user intends to use this class to apply a background image exclusively to the homepage while keeping other pages with a white background.

Current Status:
One participant reported the suggested method “doesn’t work,” indicating the solution may need refinement or alternative approaches. The discussion remains open with unresolved implementation issues.

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

Hi everyone, I am using the Dawn theme and trying to create a specific class to the tag on your home page, for example, “home-page”?

My webpage is www.lakras.co

Thank you.

Hi @lakras ,

To add a class to the <body> tag in Shopify, you can follow these steps:

  1. Go to Theme → Edit code → Find the theme.liquid file.

  1. In the theme.liquid file, locate the line starting with “<body” and add the desired class as follows:

Hope this suggestion can help you.

1 Like

Thank you! Hopefully this helps me with the other thing I want to do where I assign a background image to only the home page, where as the other pages stay white …

It doesn’t work :cry: