How do I delete header and the bar only on our landing page?

Solved

How do I delete header and the bar only on our landing page?

harukajmickey
Shopify Partner
119 0 9

Hi all, 

 

Does one know how to delete the header and the bar only on my landing page?

My URL is https://hobot-japan.com/pages/hobot-2s

 

Thank you in advance!

 

 

 

スクリーンショット 2022-10-17 16.21.28 1.png

Accepted Solution (1)

Kani
Shopify Partner
468 125 232

This is an accepted solution.

Hi @harukajmickey 

 

Kani_0-1666094965513.png

 

 

You can simply add css code to hide them.


1: Online store > themes > Actions > Edit code > Layout > theme.liquid

2: paste code before '</head>'

{% if page.handle == 'hobot-2s' %}
<style>
sticky-header, #shopify-section-announcement-bar {
    display: none!important;
}
</style>
{% endif %}

 

Hey!! ʕ ᵔᴥᵔ ʔ
Please click 'Like' and ' Accept as Solution' to encourage me to continue sharing my expertise. ♡
If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response. 🙂

View solution in original post

Replies 7 (7)

gr_trading
Shopify Partner
2040 149 206

Hi @harukajmickey ,

 

 

To remove announcement bar from landing page use below conditional statement in theme.liquid

 

To get the theme.liquid follow below steps

  1. From Shopify dashboard, go to Online store > Themes > Edit code
  2. In the search box, search for the file named theme.liquid
{%- if request.page_type != 'index' -%}
 {% section 'announcement-bar' %}
{%- endif -%}

 

For any custom development WhatsApp or connect at Email ID: support@grtrading.in for quick consultation. | Shopify Free codes
To support Buy Me a Coffee
harukajmickey
Shopify Partner
119 0 9

Thank you Hari1_prasad! Where exactly do I need to put these codes?

Kani
Shopify Partner
468 125 232

This is an accepted solution.

Hi @harukajmickey 

 

Kani_0-1666094965513.png

 

 

You can simply add css code to hide them.


1: Online store > themes > Actions > Edit code > Layout > theme.liquid

2: paste code before '</head>'

{% if page.handle == 'hobot-2s' %}
<style>
sticky-header, #shopify-section-announcement-bar {
    display: none!important;
}
</style>
{% endif %}

 

Hey!! ʕ ᵔᴥᵔ ʔ
Please click 'Like' and ' Accept as Solution' to encourage me to continue sharing my expertise. ♡
If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response. 🙂
harukajmickey
Shopify Partner
119 0 9

Hi Kani!

 

Thank you. It worked!

harukajmickey
Shopify Partner
119 0 9

Hi Kani,

 

If  I add the codes like this to apply to other pages, it didn't work. Do you know the way?

 

{% if page.handle == 'hobot-2s' or 'hobot388' %}

 

 

Thank you in advance.

Kani
Shopify Partner
468 125 232

Hi @harukajmickey 

 

It should be 

{% if page.handle == 'hobot-2s' or page.handle == 'hobot388' %}
Hey!! ʕ ᵔᴥᵔ ʔ
Please click 'Like' and ' Accept as Solution' to encourage me to continue sharing my expertise. ♡
If you need any technical assistance, feel free to send me a DM. You no longer have to search for answers without getting a response. 🙂
harukajmickey
Shopify Partner
119 0 9

Thank you @Kani !!