i want to create a function where admin select the tag image and after that its showing like this on product image. How can i do this
Topic summary
A Shopify store admin wants to display custom badge labels (like “Trending” or “Bestseller”) overlaid on product images in their online store.
Proposed Solution:
- Add product tags in the format
_label:Trendingor_label:Best Sellerthrough the Shopify admin panel - Insert Liquid code snippet into the theme’s product template that loops through product tags, filters those containing “_label:”, and displays the label text
- Adjust CSS positioning to place badges correctly on product images
Current Issue:
The original poster has attempted multiple implementations but the badges aren’t displaying on the frontend. When inspecting the HTML, a <div> with class “product-image-badge-wrapper” appears but remains blank.
Troubleshooting Steps Taken:
- Added tag as
_label:Trendingto test product - Tried various Liquid code variations in product.liquid template
- Verified code renders empty div elements on inspection
Status: Unresolved. The helper identified that an old/incorrect tag format still exists on the product, suggesting the proper _label:Trending tag may not have been saved correctly or the code placement needs adjustment.
Correct me if I am wrong: you want to add the “Trending”, “Bestseller” or any custom tag added from your admin panel to your product featured image in your online store.
To do this, you need your theme to support it, check in your theme documentation or try customizing your theme in your editor to check if the option is available. If not available, you need to modify the templates section of your code or trying another theme that have this feature.
how to do this from theme end sir
Hi,
I hope you are doing good.
You can do this with the help of some liquid snippet.
You can add tags to products like _label:Trending, _label:Best Seller etc..
and then in the code, you can reference them like this
{% for tag in product.tags %}
{% if tag contains "_label:" %}
{{ tag | split: "_label:" | last }}
{% endif %}
{% endfor %}
I hope, my answer is useful to you.
Thanks!
i add this code to product.liquid and on label i add trending and on product i add a tag also trending. but its not showing on frontend
Firstly, you have to add tag like this _label:Trending
and it is just an idea, you can inspect the html to see if it is showing and then adjust css to appear at proper place.
Thanks!
on inspect its showing like
" "
its showing blank
Can you please share product url ?
i use this and add Trending tag in product
Your product tag is incorrect,
add _label:Trending as product tag
and the use this code
{% for tag in product.tags %}
{% if tag contains "_label:" %}
{{ tag | split: "_label:" | last }}
{% endif %}
{% endfor %}
Thanks!
not work on my store i try many more methods .
now i add product tag as _label:Trending and paste code that you send and also this code

