Hide Articles By Label - Label Out of Home

Updated: 01 Mar, 2018 March 01, 2018
When you design a website using blogspot, sometimes you want to hide certain posts outside the home page so that the site becomes more professional. So how to implement this technique? Please explore the detailed content in this article .

Hide Article Out Of Home By Label

The simplest way to do this is to simply assign the unwanted posts to a label you specify. Then follow these steps:
Step 1 : Find the line <b: includable id = 'main' var = 'top'>

Find the html snippet as below:

<b:loop values='data:posts' var='post'>
<b:include data='post' name='post'/>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<b:include data='post' name='comments'/>
<b:if cond='data:post.includeAd'>
<b:if cond='data:post.isFirstPost'>
<b:if cond='data:post.trackLatency'>

Replace the code found with the following code:

<b:loop values='data:posts' var='post'><b:if cond='data:blog.url == data:blog.homepageUrl'><b:if cond='data:post.labels'><b:loop values='data:post.labels' var='label'><b:if cond='data:label.isLast == &quot;true&quot;'>
<b:if cond='data:label.name != "A Label"'>
<b:include data='post' name='printPosts'/></b:if></b:if></b:loop></b:if><b:else/><b:include data='post' name='printPosts'/></b:if></b:loop>


- A Label : the label should be hidden. VD: template blogspotThủ Thuật Blogspot, Youtube,Kiếm Tiền Online ... etc
- There are distinctive flowers in the article label and hidden code
Step 2: Find the closing tag </ b: includable> of the line <b: includable id = 'main' var = 'top'>
Then put the code below immediately after the closing tag found:

<b:includable id='printPosts' var='post'>
<b:if cond='data:post.dateHeader'>
<h2 class='date-header'>
<b:include data='post' name='post'/>
<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
<b:include data='post' name='comments'/>
<b:if cond='data:blog.pageType == "item"'>
<b:include data='post' name='comments'/>

Step 3: Find the articles you do not want to display outside the home page and assign A Label to the label section . Articles with this label will automatically hide outside the home page .
Additional Notes:
- A label is a label you can change as you like

Good luck!
Liên hệ quảng cáo