Blogger main page filter posts on labels -


i need filtering out posts based on labels (displaying posts label) on main page of blogger on custom template has follow code:

<b:loop values='data:posts' var='post'>     <b:if cond='data:post.isdatestart'>       <b:if cond='data:post.isfirstpost == &quot;false&quot;'>         &lt;/div&gt;&lt;/div&gt;       </b:if>     </b:if>     <b:if cond='data:post.isdatestart'>       &lt;div class=&quot;date-outer&quot;&gt;     </b:if>            <b:if cond='data:post.isdatestart'>       &lt;div class=&quot;date-posts&quot;&gt;     </b:if>     <div class='post-outer'>     <b:include data='post' name='post'/>     <b:if cond='data:blog.pagetype == &quot;static_page&quot;'>       <b:include data='post' name='fn_comment_picker'/>     </b:if>     <b:if cond='data:blog.pagetype == &quot;item&quot;'>       <b:include data='post' name='fn_comment_picker'/>     </b:if>     </div>           </b:loop> 

replace

<b:include data='post' name='post'/> 

with

<b:if cond='data:post.labels'> <b:loop values='data:post.labels' var='label'> <b:if cond='data:label.name == &quot;your label&quot;'>                                                 <b:include data='post' name='post'/> </b:if> </b:loop> </b:if> 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -