问题
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?
回答1:
I think It's possible! Just need little bit hard work.
First add CSS.
Then search for
<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>
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.
来源:https://stackoverflow.com/questions/53910696/how-to-show-posts-of-certain-label-or-category-in-a-row-in-my-blogger-home-page