Trying to get the announcement bar sticky on Mojave theme. Ive tried solutions for Dawn theme but they aren’t working.
Website: www.matthewsjewellers.com
Trying to get the announcement bar sticky on Mojave theme. Ive tried solutions for Dawn theme but they aren’t working.
Website: www.matthewsjewellers.com
Hi @Adam_Matthews ,
Here are the steps you can follow:
1, Navigate to Online Store > Themes > Edit Code.
2, Locate and open the base.css (or theme.css, custom.css) file.
3, Paste the code snippet provided below at the bottom of the file, then save your changes.
.announcement-bar {
background: #fff !important;
position: fixed !important;
top: 0 !important;
}
.header-wrapper {
position: fixed;
top: 48px;
width: 100%;
}
Here is the result
We hope this assists in resolving the issue.
If you find our solution helpful, kindly consider Liking and Marking it as Accepted. Thank you!
Hello @Adam_Matthews
Please follow steps
Access Your Theme’s Code:
Identify the Announcement Bar:
Add CSS for Sticky Position:
Modify the CSS:
.announcement-bar {
position: -webkit-sticky; /* For Safari */
position: sticky;
top: 0;
z-index: 1000; /* Ensures it stays above other content */
width: 100%;
background-color: #fff; /* Adjust as needed */
/* Add any additional styling you need */
}
Ensure you replace the .announcement-bar with the actual class or ID used in your theme if it’s different.
Adjust JavaScript (if needed):
Hello @Adam_Matthews
Go to online store ---------> themes --------------> actions ------> edit code------->base.css
add this code at the very end of the file.
sticky-header {
position: fixed !important;
width: 100% !important;
top: 40px !important;
}
.announcement-bar {
position: fixed;
background: #fff !important;
}
result
If this was helpful, hit the like button and mark the job as completed.
Thanks
Follow these Steps:
If you require further help to optimize your store, please don’t hesitate to reach out. If you find this information useful, a Like would be greatly appreciated. And if this solves the problem, please Mark it as Solution!
Best Regards,
Makka
Please add this code to theme.liquid file, after in Online Store > Themes > Edit code