Show relevant tags under products.

New Member
5 0 0

I want to show relevant tags under products. (Not all)

Since some of the products looks a bit similar, I want to add the following Tags to the product.liquid: Male , female.

And if possible the brand.

I tried using the following code without luck

{% if product.tags.size > 0 %}
  <div class="product-single__tags">
      {% for tag in product.tags %}
      {% assign tag_coll = '/collections/all/' | append: tag %}
        {{ tag | capitalize | link_to: tag_coll }}{% unless forloop.last %},{% endunless %}
      {% endfor %}

I also want to make them clickable similar to the screenshot and the button on this page 
This is an add-on from this question

<ul class="product-tags">
  {% for tag in product.tags %}
  <li><a href="/collections/all/{{ tag | handleize }}">{{ tag }}</a></li>
  {% endfor %}

But did not get it as I wanted. Someone wanna help? :D

Using Brooklyn Theme. 



Shopify Expert
2507 423 532

Hi @Ikke-69 

Try this:

This will show link if tag is Male or female


{% for tag in product.tags %}
{% if tag contains 'Male' or tag contains 'female' %}
	<li>{{ tag | link_to_tag: tag }}</li>
{% endif %}
{% endfor %}

Change your tag with Male or female


Want to modify or custom changes on store hire me.
If helpful then please Like and Accept Solution.
Skype: jasoliya.brijesh
Want to get Free review and advice for sale on store ?? just text me here
1 Like