How can I make my announcement bar sticky with the header?

How can I make my announcement bar sticky with the header?

9INE
Shopify Partner
27 0 4

Hi, I am trying to make my announcement bar sticky with the header but I've tried everything and can't figure it out. The header is sticky but I want the announcement bar to also be sticky with it. Would greatly appreciate it if you know how to get this done. Site is shopworms.com


sticky ahh.jpg

Replies 2 (2)

Dan-From-Ryviu
Shopify Partner
10792 2133 2250

Hi @9INE 

Go to your Online store > Themes > Edit code > open theme.liquid file, add this code before </head> tag

<style>
#shopify-section-sections--20163871736081__announcement-bar {
    position: sticky;
    top: 0px;
}
#shopify-section-sections--20163871736081__header { top: 42px; }
@media(max-width: 767px) {
#shopify-section-sections--20163871736081__header { top: 50px; }
}
</style>

- Solved it? Hit Like and Accept solution! ❤️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: Easy and fast to create Photo Gallery, Lookbook, Shop The Look.
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- Enjoy 1 month of Shopify for $1. Sign up now.

9INE
Shopify Partner
27 0 4

IMG_4125.png

worked for desktop, but not mobile. There is a space between the announcement bar and header.