HIDE HEADER AND FOOTER IN HOMEPAGE - MOTION THEME

oslagod
Tourist
6 0 0

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!

Replies 4 (4)

wo
Shopify Partner
73 20 17

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 %}
oslagod
Tourist
6 0 0

i already tried something like this but i didnt notice any changes, should i copy and paste it or i have to change something?

PageFly-Henry
Astronaut
984 281 225

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.

PageFlyHenry_0-1709260428971.png

 


{% 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.

oslagod
Tourist
6 0 0

i already tried something like this but didnt notice any changes, should i copy and paste it or i have to change something?