Shopify themes, liquid, logos, and UX
Hi there!
I'm trying to remove my blog tags from the debut theme and can't seem to get it to work. I've searched the forums and tried a few options, but I can't seem to get rid of them. My real issue is that, I tagged my latest blog post with "exclude-from-email" which I was assuming would also be a hidden tag, and it's not. *womp womp* So, I guess I need to remove them all now..
One of the options was this, but it didn't work for me:
blog-template.liquid (Lines 78-88)
{% if article.tags.size > 0 %} <li class="list--inline__separator"> {% for tag in article.tags %} <a href="{{ blog.url }}/tagged/{{ tag | handle }}">{{ tag }}</a>{% unless forloop.last %}, {% endunless %} {% endfor %} </li> {% endif %} (this didn't copy the way I pasted it!)
If you have any suggestions, I would greatly appreciate it!
Thanks! - Kel
Solved! Go to the solution
This is an accepted solution.
Hi @KelMurphy, you need to comment out blog-template line 165-172. Wrap the div with the comment tag:
{% comment %}
{% if article.tags.size > 0 %}
<div class="article__tags article__tags--list rte">
{{ 'blogs.article.posted_in' | t }}
{% for tag in article.tags %}
<a href="{{ blog.url }}/tagged/{{ tag | handle }}">{{ tag }}</a>{% unless forloop.last %}, {% endunless %}
{% endfor %}
</div>
{% endif %}
{% endcomment %}
This is an accepted solution.
@KelMurphy If you want to exclude specific tags but show other tags, then rather than commenting out the code, you can exclude them from the loop using "exclude-" tag. So this code will show other tags, but not tags which contain the word 'exclude' eg. 'exclude-from-blog' or 'exclude-from-mail':
{% if article.tags.size > 0 %}
<div class="article__tags article__tags--list rte">
{{ 'blogs.article.posted_in' | t }}
{% for tag in article.tags %}
{% unless tag contains 'exclude-' %}
<a href="{{ blog.url }}/tagged/{{ tag | handle }}">{{ tag }}</a>{% unless forloop.last %}, {% endunless %}
{% endunless %}
{% endfor %}
</div>
{% endif %}
This is an accepted solution.
Hi @KelMurphy, you need to comment out blog-template line 165-172. Wrap the div with the comment tag:
{% comment %}
{% if article.tags.size > 0 %}
<div class="article__tags article__tags--list rte">
{{ 'blogs.article.posted_in' | t }}
{% for tag in article.tags %}
<a href="{{ blog.url }}/tagged/{{ tag | handle }}">{{ tag }}</a>{% unless forloop.last %}, {% endunless %}
{% endfor %}
</div>
{% endif %}
{% endcomment %}
This is an accepted solution.
@KelMurphy If you want to exclude specific tags but show other tags, then rather than commenting out the code, you can exclude them from the loop using "exclude-" tag. So this code will show other tags, but not tags which contain the word 'exclude' eg. 'exclude-from-blog' or 'exclude-from-mail':
{% if article.tags.size > 0 %}
<div class="article__tags article__tags--list rte">
{{ 'blogs.article.posted_in' | t }}
{% for tag in article.tags %}
{% unless tag contains 'exclude-' %}
<a href="{{ blog.url }}/tagged/{{ tag | handle }}">{{ tag }}</a>{% unless forloop.last %}, {% endunless %}
{% endunless %}
{% endfor %}
</div>
{% endif %}
Glad I could help! 🙂
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024