Your sites Log in Sign up Menu

Exclude some tags in list of tags

Is there a way to exclude some specific tags from being displayed in a list of tags (i.e. {{#all_tags}})? Thanks!


2 years ago, 3 replies   Improve this question

You could use CSS to selectively hide a given tag. Let's say your tag list looks like:

{{#all_tags}}
<a href="/tagged/{{slug}}">{{tag}}</a>
{{/all_tags}}

You could then hide the tags 'apple', 'pear' and 'strawberry' like so:

<style>
a[href="/tagged/apple"]
a[href="/tagged/pear"],
a[href="/tagged/strawberry"] { display: none }
</style>
Answered 2 years ago · Improve this answer

That did the trick, thanks!

Answered 2 years ago · Improve this answer

Would it be possible to exclude specific tags in different HTML scenario, such as this one? (This lists tags on the side margin of a post):

 <span class="small date left margin">{{#tags}}{{name}}{{/tags}}</span>

Say I want to exclude/hide tag name "garden" for example.

Thanks! Ray

Answered 2 years ago · Improve this answer