Wednesday, March 21, 2018

Blogger: 用label隱藏Post

在Design中找到Theme,先備份一次,再進入Edit HTML。
找到
<b:include data='post' name='post'/>
把它替換成
<b:if cond='data:blog.url == data:blog.homepageUrl'>
<b:loop values='data:post.labels' var='label'>
        <b:if cond='data:label.isLast == "true"'>
            <b:if cond='data:label.name != "add label here"'>
                <b:include data='post' name='post' />
            </b:if>
        </b:if>
    </b:loop>
<b:else/>
    <b:include data='post' name='post' />
</b:if>
然後到Layout,找到Labels模組,修改Show方式由All改為Selected Labels。

Reference: How to hide posts from blogger homepage

No comments: