Hide Header, Announcement bar, and footer on Landing page

Solved

Hide Header, Announcement bar, and footer on Landing page

abmhr
Shopify Partner
8 1 0

Hi altogether!

After lots of research and a few mental breakdowns, I came to the conclusion to ask here for help.

 

I want to hide my header, announcement bar and footer only on the main page/ home page or however you want to call it.

 

I’m using the Origin theme.

 

I was able to hide the header already with this code added above the </head> in the theme.liquid :

 

{% if template.name == "index" %} <style> .section-header { display: none !important; } </style> {% endif %} {% if handle contains 'about-us' %} <style> .section-header { display: none !important; } </style> {% endif %} {% if handle contains 'shop' %} <style> .section-header { display: none !important; } </style> {% endif %}

 

Now I thought I could be smart and just exchange .section-header for either .section-announcement_bar, announcement.bar, or announcement-bar

 

Neither of those worked. 😕

 

Same with the footer I copied the code above and below </body> and changed .section-header to .section-footer (I also deleted the other if-then logics)

 

Neither works. Any help would be appreciated 🫶🏼 thank you!

Accepted Solution (1)
namphan
Shopify Partner
1093 135 168

This is an accepted solution.

Hi @abmhr,

Please add code:

{% if template.name == "index" %} 
<style> .section-header, .announcement-bar, .footer { display: none !important; } </style> 
{% endif %} 
{% if handle contains 'about-us' %} 
<style> .section-header, .announcement-bar, .footer { display: none !important; } </style> 
{% endif %} 
{% if handle contains 'shop' %} 
<style> .section-header, .announcement-bar, .footer { display: none !important; } </style> 
{% endif %}

 

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com

View solution in original post

Replies 10 (10)

Acme
Shopify Partner
69 8 13

Hi, @abmhr 
I am familiar with this issue. Please share your store url(password). Thanks.

namphan
Shopify Partner
1093 135 168

Hi @abmhr,

Please change code:

{% if template.name == "index" %} 
<style> .section-header, .announcement-bar, .shopify-section-footer { display: none !important; } </style> 
{% endif %} 
{% if handle contains 'about-us' %} 
<style> .section-header, .announcement-bar, .shopify-section-footer { display: none !important; } </style> 
{% endif %} 
{% if handle contains 'shop' %} 
<style> .section-header, .announcement-bar, .shopify-section-footer { display: none !important; } </style> 
{% endif %}
Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
namphan
Shopify Partner
1093 135 168

This is an accepted solution.

Hi @abmhr,

Please add code:

{% if template.name == "index" %} 
<style> .section-header, .announcement-bar, .footer { display: none !important; } </style> 
{% endif %} 
{% if handle contains 'about-us' %} 
<style> .section-header, .announcement-bar, .footer { display: none !important; } </style> 
{% endif %} 
{% if handle contains 'shop' %} 
<style> .section-header, .announcement-bar, .footer { display: none !important; } </style> 
{% endif %}

 

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
abmhr
Shopify Partner
8 1 0

You're a genius! Thank you, I really appreciate it! ❤️

namphan
Shopify Partner
1093 135 168

Hi @abmhr,

If you have any questions, you can contact me directly.
Happy to help you 😊

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
abmhr
Shopify Partner
8 1 0

Thank you! But unfortunately, this only works partially for the header and announcement bar. Footer is still shown...

 

namphan
Shopify Partner
1093 135 168

Hi @abmhr,

Can you send me the store link? I will check it for you

Coffee tips fuels my dedication.
Shopify Development Service
Need help with your store? namphan992@gmail.com
abmhr
Shopify Partner
8 1 0

The second one you sent was the solution! Thank you lots!

Sangeetanahar
Excursionist
384 25 53

Hello @abmhr 

online store...>editcode....>theme.liquid and paste the code line number 40

{% if template.name == "index" %} 
  <style> .section-header,.announcement-bar,.shopify-section-footer { display: none !important; } </style>
  {% endif %} 
    {% if handle contains 'about-us' %} 
      <style> .section-header,.announcement-bar,.shopify-section-footer { display: none !important; } </style> 
      {% endif %} 
    {% if handle contains 'shop' %}
      <style> .section-header,.announcement-bar,.shopify-section-footer { display: none !important; } </style> 
      {% endif %}

and also check the screenshot 

ccccc.png

thanks

 

 

 

Was I helpful?

Buy me a coffee



Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -sangeetarahuldhiman@gmail.com - Skype: live:sangeetarahuldhiman -Whatsapp: +917009811712
Checkout Some Free Sections Here
abmhr
Shopify Partner
8 1 0

Hi! Thank you! Unfortunately this only works partially for the Header and Announcement bar. The footer probably needs to be added somewhere else since its not part of the "Header" itself. Any thoughts? I tried to put this line of code, underneath the </body> as well.
Thank you!