How to Hide Blogger Posts with Specific Labels

Do you want to hide blogger posts with a specific label from your site's homepage? If the answer is yes, follow this blogger tutorial to exclude posts from a specific category or specific categories.

First go to "Edit HTML" page of your blog. (Note: Please backup your template before doing any changes)

Find this line:
<b:include data='post' name='post'/>
It will look like this:


Replace it with below code:
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name != "YOUR_LABEL_NAME"'>
<b:include data='post' name='post'/>
</b:if>
</b:loop>
<b:else/>
<b:include data='post' name='post'/>
</b:if>
Important: Replace the word YOUR_LABEL_NAME with the label name you want to hide posts from.

To exclude posts from multiple categories, use the below code instead of the above code.
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.name != "YOUR_FIRST_LABEL_NAME" and data:label.name != "YOUR_SECOND_LABEL_NAME"'>
<b:include data='post' name='post'/>
</b:if>
</b:loop>
<b:else/>
<b:include data='post' name='post'/>
</b:if>
Important: Replace the words YOUR_FIRST_LABEL_NAME and YOUR_SECOND_LABEL_NAME with the label names you want to hide posts from.
http://www.bloggertipandtrick.net/hide-blogger-posts-with-specific-labels/
Share this on Google+ Tumblr

Leave a comment

To insert a link, use tag [url=http://your_link]your-link[/url]
To insert the code , use the tag <i rel="code">your-code</i>
The long code can use the tag <i rel="pre">your-long-code</i>
To insert an image , use the code [img]URL Image[/img]
To insert a title , use tag <b rel="h4">Your Title here...</b>
To creat Bold text <strong>Your text here...</strong>
To create Italic text used tag <em>Your text here...</em>

:) :( :p :D :o ;) 8-) 8:) :/ :'( 3:) O:) :* <3 ^_^ -_- o.O O.o >:o :v :3
Cancel