如何在我的博客主页上连续显示某些标签或类别的帖子? [英] How to show posts of certain label or category in a row in my blogger home page?
问题描述
我想首先在博客主页中包含最新的帖子,然后创建包含特定标签的帖子的行.我想显示不同标签的不同行.
I want to first include latest posts in my blog home page and then I want to create a row containing posts of a certain label. I want to display different rows of different labels.
这就是我要设计博客的方式.但是我不知道如何编码博客,以便某些标签的帖子显示在该行中.
That's how I want to design my blog. But I don't know how to code blogger so that posts of certain labels are shown in that row.
我该如何称呼它们或将它们显示在那一行?
How do I call them or display them in that row?
推荐答案
我认为有可能!只是需要一点点的努力.
I think It's possible! Just need little bit hard work.
首先添加CSS.
然后搜索
<b:include data='post' name='post' />
现在用此代码替换此代码-
Now replace this code with this one -
<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 != "Your First Label Name"'><div class='row'><b:include data='post' name='post' /></div></b:if>
<b:if cond='data:label.name != "Your Second Label Name"'><div class='row'><b:include data='post' name='post' /></div></b:if>
<b:if cond='data:label.name != "Your Third Label Name"'><div class='row'> <b:include data='post' name='post' /></div></b:if>
</b:if></b:loop><b:else/><b:include data='post' name='post' /></b:if>
注意:您应该记住,每个帖子都应该有一个标签.并且不要忘记在文章中添加class ='column'.
Note: you should remember that every post should have one label. And don't forget to add class='column' in article.
我不尝试.自己检查一下并给我反馈.
I don't try it. Check it by yourself and give me feedback.
这篇关于如何在我的博客主页上连续显示某些标签或类别的帖子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!