I’m working on customizing my Shopify store and I’ve encountered an issue. I want the header and footer to be hidden only on the homepage, but visible on all other pages. I included a code snippet in the theme.liquid file that works to some extent, but not completely.
Here is the code I used:
{% if template.name != 'index' %}
{% include 'header' %}
{% endif %}
{{ content_for_layout }}
{% if template.name != 'index' %}
{% include 'footer' %}
{% endif %}
it works but it is duplicated and generates header and footer
HEEELP MEE PLEASE !! I AM NOOOB
1 Like
Hi @hatmakerr
Check this one.
From your Shopify admin dashboard, click on “Online Store” and then “Themes”
Find the theme that you want to edit and click on “Actions” and then “Edit code”.
In the “theme. Liquid” file. Find the tag and paste the code below before the tag.
{% if template.name == 'index' %}
{% endif %}
And Save.
Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!
1 Like
YYEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEES you helped me a lot!! hours trying and with your help it worked perfectly! I love you
Welcome! Would you mind hitting ‘like’ as well? Thanks!
1 Like