Solved

Removing Blog Tags from Debut Theme

KelMurphy
Excursionist
19 0 5

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

Accepted Solutions (2)

g33kgirl
Shopify Partner
390 109 142

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 %}

 

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl
If you're not comfortable with code, please modify code files at your own risk.

View solution in original post

g33kgirl
Shopify Partner
390 109 142

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 %}

 

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl
If you're not comfortable with code, please modify code files at your own risk.

View solution in original post

Replies 5 (5)

g33kgirl
Shopify Partner
390 109 142

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 %}

 

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl
If you're not comfortable with code, please modify code files at your own risk.
KelMurphy
Excursionist
19 0 5

@g33kgirl YESSS! Thank you SO much! This worked perfectly!

g33kgirl
Shopify Partner
390 109 142

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 %}

 

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl
If you're not comfortable with code, please modify code files at your own risk.
KelMurphy
Excursionist
19 0 5

@g33kgirl  This is even better!!! Thanks so much! 

g33kgirl
Shopify Partner
390 109 142

Glad I could help! 🙂

If you found my answer helpful, please LIKE and ACCEPT.
buymeacoffee.com/g33kgirl
If you're not comfortable with code, please modify code files at your own risk.