How to show announcement bar only on mobile homepage

Solved

How to show announcement bar only on mobile homepage

vcockerham2002
Excursionist
35 0 1

Hi there, I would like to make an announcement bar that only shows on the homepage of mobile.  TIA my site is appleblossomgiftbaskets.com 

Accepted Solutions (2)

Dan-From-Ryviu
Shopify Partner
11308 2214 2383

This is an accepted solution.

Hi @vcockerham2002 

I'm Dan from Ryviu: Product Reviews & QA app.

You can add this code to your theme.liquid file to make it show only on mobile homepage.

{% if template == 'index' %}
<style>
@media (max-width: 749px) {
.utility-bar .announcement-bar { display: flex; }
}
</style>
{% else %}
<style>
.utility-bar .announcement-bar { display: none; }
</style>
{% endif %}

 

- Found this helpful? Hit "Like" and "Accept as Solution"! - Feeling generous. Buy me coffee!
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
Built for Shopify

Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

View solution in original post

BrainStation23
Shopify Partner
416 62 61

This is an accepted solution.

hi @vcockerham2002 
You can follow these steps to achieve your result 
Go to online stores -> Themes  -> Edit code->theme. liquid file
Then paste the below  code above  </head>  tag

{% if template == 'index' %}

  <style>
    @media screen and (max-width: 768px) {
     .utility-bar 
     .announcement-bar
      {
        display: flex; 
      }
    }
  </style>

{% else %}
  <style>

    .utility-bar 
    .announcement-bar
     { 
       display: none; 
     }

  </style>
{% endif %}
Brain Station 23 PLC (Mail: js.sbu@brainstation-23.com)
- Was your question answered? Mark it as an Accepted Solution
- Did the solution not address your concern? We kindly request that share or mail your store URL with us this will enable us to collaborate more closely.
- Explore our Shopify public apps

View solution in original post

Replies 2 (2)

Dan-From-Ryviu
Shopify Partner
11308 2214 2383

This is an accepted solution.

Hi @vcockerham2002 

I'm Dan from Ryviu: Product Reviews & QA app.

You can add this code to your theme.liquid file to make it show only on mobile homepage.

{% if template == 'index' %}
<style>
@media (max-width: 749px) {
.utility-bar .announcement-bar { display: flex; }
}
</style>
{% else %}
<style>
.utility-bar .announcement-bar { display: none; }
</style>
{% endif %}

 

- Found this helpful? Hit "Like" and "Accept as Solution"! - Feeling generous. Buy me coffee!
- Reton: Loyalty & Rewards - Earn points through tasks, redeem for discounts, and enjoy exclusive VIP rewards!
- Ryviu - Reviews & QA app: Collect product reviews, import reviews from AliExpress, Amazon, Etsy, Walmart, Shopee, Dhgate and CSV.
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
Built for Shopify

Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

BrainStation23
Shopify Partner
416 62 61

This is an accepted solution.

hi @vcockerham2002 
You can follow these steps to achieve your result 
Go to online stores -> Themes  -> Edit code->theme. liquid file
Then paste the below  code above  </head>  tag

{% if template == 'index' %}

  <style>
    @media screen and (max-width: 768px) {
     .utility-bar 
     .announcement-bar
      {
        display: flex; 
      }
    }
  </style>

{% else %}
  <style>

    .utility-bar 
    .announcement-bar
     { 
       display: none; 
     }

  </style>
{% endif %}
Brain Station 23 PLC (Mail: js.sbu@brainstation-23.com)
- Was your question answered? Mark it as an Accepted Solution
- Did the solution not address your concern? We kindly request that share or mail your store URL with us this will enable us to collaborate more closely.
- Explore our Shopify public apps