i am trying to add a announcement banner on only a single page of my website. or better said only on one product landing page.
If it can be UNDER the navigation area, in OS2.0 themes just use a custom-liquid/custom-html section.
And use any online banner generator that gives HTML code.
Some themes may have this feature in the header group.
Or just reach out to me for theme customization services.
Click my profile pic on the forum for faster direct options.
Depending on how the announcement bar is being coded into your theme, you could likely achieve this by
a) adding a metafield implementation such that the bar only appears for the one product with that field filled out; or
b) assigning that single product landing page to a different product template.
If you’re looking to implement this urgently, I’d be happy to look into this for you with expediency.
You can try to use a free announcement app to do that, for example: Annify
Hi @d2r ,
To show an announcement banner on only one product landing page in your Shopify store, you can do this with a conditional Liquid statement targeting that specific product. Here’s how to do it:
- Go to Online Store > Themes > Edit code.
- Open
theme.liquid(orheader.liquidif your banner goes there). - Add this code where you want the banner to show (usually below
<body>or inside header):
{% if template == 'product' and product.handle == 'your-product-handle' %}
<div class="announcement-banner" style="background: #fce4b2; text-align: center; padding: 10px;">
<p>🎉 Special offer just for this product!</p>
</div>
{% endif %}
Replace 'your-product-handle' with the actual handle of the product (you’ll find it in the product URL or admin).
Hey @d2r,
Could you please share the landing page/product-page link where you want to show the announcement bar so that I can provide you the solution code accordingly.
Hi @d2r,
You can create a new template for just one product and add an ‘announcement banner’ section to it. Therefore, it will only show up on one product and not anywhere else.
You can refer to the following article.
If I helped you, then a Like would be truly appreciated.