Shopify themes, liquid, logos, and UX
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!
Solved! Go to the solution
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 %}
Hi, @abmhr
I am familiar with this issue. Please share your store url(password). Thanks.
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 %}
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 %}
You're a genius! Thank you, I really appreciate it! ❤️
Hi @abmhr,
If you have any questions, you can contact me directly.
Happy to help you 😊
Thank you! But unfortunately, this only works partially for the header and announcement bar. Footer is still shown...
Hi @abmhr,
Can you send me the store link? I will check it for you
The second one you sent was the solution! Thank you lots!
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
thanks
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!
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024