Shopify themes, liquid, logos, and UX
Hello, I would like to know how I can hide the header and footer only on the homepage.
I'm using Shopify's motion theme,
thanks!
In theme.liquid, add conditions to the referenced header and footer codes.
{% if template.name == 'index' %}
{% sections 'header-group' %}
{% endif %}
-----------------------------------
{% if template.name == 'index' %}
{% sections 'footer-group' %}
{% endif %}
i already tried something like this but i didnt notice any changes, should i copy and paste it or i have to change something?
Hi @oslagod
This is Henry from PageFly - Landing Page Builder App
You can try this code by following these steps:
Step 1: Go to Online Store->Theme->Edit code.
Step 2: Search file theme.liquid
Step 3: paste bellow code in tag </body> -> save.
{% if template == 'index' %}
<style>
header, footer {
display: none !important;
}
</style>
{% endif %}
Hope that my solution works for you.
Best regards,
Henry | PageFly
Please let me know if it works by giving it a Like or marking it as a solution!
PageFly - #1 Page Builder for Shopify merchants.
All features are available from Free plan. Live Chat Support is available 24/7.
i already tried something like this but didnt notice any changes, should i copy and paste it or i have to change something?
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025