当前位置: 动力学知识库 > 问答 > 编程问答 >

html - Hide Specific label posts from homepage in blogger

问题描述:

I have a website for Best Whatsapp Status on blogger blog . I want to hide some specific label posts from the homepage . Is there anyway to do that with coding.

I have searched a lot but nothing worked for me . Please help anyone

网友答案:

Go to your template editor, then find the code below: (Please BACKUP your template first)

<b:if cond='data:post.dateHeader'>
    <h2 class='date-header'><data:post.dateHeader/></h2>
</b:if>
<b:include data='post' name='post'/>

If you can't find the code, just find that similiar to that. Replace that code with this code:

<b:if cond='data:blog.url == data:blog.homepageUrl'>
<b:if cond='data:post.labels == &amp;quot;&amp;quot;'>
<b:if cond='data:post.dateHeader'>
<h2 class='date-header'><data:post.dateHeader/></h2>
</b:if>
<b:include data='post' name='post'/>
</b:if>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.isLast'>
<b:if cond='data:label.name != &amp;quot;LABEL NAME&amp;quot;'>
<b:if cond='data:post.dateHeader'>
<h2 class='date-header'><data:post.dateHeader/></h2>
</b:if>
<b:include data='post' name='post'/>
</b:if>
</b:if>
</b:loop>
<b:else/>
<b:if cond='data:post.dateHeader'>
<h2 class='date-header'><data:post.dateHeader/></h2>
</b:if>
<b:include data='post' name='post'/>
</b:if>

Replace LABEL NAME with the label name that you want to hide from homepage. It may be case sensitive!

网友答案:

I recently wrote about that in my blog, using a little bit of a different approach, with javascript. Maybe this'll work for you:

http://bekreatief.blogspot.com/2014/07/blogger-take-certain-post-out-of-stream.html

分享给朋友:
您可能感兴趣的文章:
随机阅读: