how to add different class on home page and other page templates

Solved
ErSanjay
Trailblazer
146 18 23

i want to change the design layout based on the home page and other subpages how I can apply css based on templates 

0 Likes
ErSanjay
Trailblazer
146 18 23

This is an accepted solution.

i found the answer on  https://www.shopify.in/partners/blog/92262598-creating-useful-css-hooks-in-liquid

 

edit your theme.liquid file 

 

 <main id="content" class=" {% if template == 'index' %}content_home_index{% else%}non_home
{% endif %}"  role="main">
0 Likes