Did you ever think to hide SOME CERTAIN LABELS from your homepage or in blog post ?? Don't understand what I'm talking about?? See picture below (click image to enlarge size).
| Labels in Homepage. | Labels in Blog post. |
Well if that's what you're looking for,, you come to right place. Otherwise feel free to browse another article I made :P
Okay.. what's next??
First,, always BACKUP your template before editing cause anything could happen,, isn't??Now open your template editor (Dashboard => Template => Edit HTML) and find code :
<b:loop values='data:post.labels' var='label'>
* Don't worry If you found more than one,, it's just normal. They have same purpose (shows label),, you can skip it for now.
Found it?? Add this code right AFTER :
<b:if cond='data:label.name' != "HIDE"'>* Change red colored text with label name that you want to hide.
* This is case sensitive letter
Just few line after (or more) you will see :
</b:loop>* DO NOT search it with Ctrl+F cause you'll found too much and mostly will screw your template.
Add this code BEFORE it :
</b:if>Now your code should be looks like this :
<!-- any code,, don't worry this just comment-->
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name != "HIDE"'>
<!-- any code,, don't worry this just comment-->
<!-- any code,, don't worry this just comment-->
<!-- any code,, don't worry this just comment-->
</b:if>
</b:loop>
<!-- any code,, don't worry this just comment-->
If you want to hide more than one labels,, just repeat the process by add more code. here is sample code :
<!-- any code,, don't worry this just comment-->Done editing?? Now save your template and let see..
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name != "HIDE"'>
<b:if cond='data:label.name != "HIDE2"'>
<!-- any code,, don't worry this just comment-->
<!-- any code,, don't worry this just comment-->
<!-- any code,, don't worry this just comment-->
</b:if>
</b:if>
</b:loop>
<!-- any code,, don't worry this just comment-->
UPDATE : a bit simple less code if you wanna hide more than one label
<!-- any code,, don't worry this just comment-->
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name != "HIDE" AND data:label.name != "HIDE2" AND data:label.name != "HIDE3"'>
<!-- any code,, don't worry this just comment-->
<!-- any code,, don't worry this just comment-->
<!-- any code,, don't worry this just comment-->
</b:if>
</b:loop>
<!-- any code,, don't worry this just comment-->
Thank you! Is there a code if I want to show only certain labels? For example, I have categories on my blog (travel, art, movies...) and I use tags on my posts (name of the country I traveled to, name of artist, name of the movie...). I want the post to show only the CATEGORIES, not the TAGS. But there are waaay more tags than categories, so it would be much simpler if I could choose which ones I want to be visible instead of hiding all the others. Do you know if that`s possible?
ReplyDeleteI don't know that there was someone commenting my post.
DeleteHi Gaby, I'm sorry.. Google doesn't give me any notification about this.
On topic :
Would you screenshot me :
1. Your current view [?] and
2. Your desired result (just draw strike on them would be enough).
#I'm bad at understanding words.
#For fast reply please mail me instead.