Limit number of posts displayed in label page blogger

By default, readers can only read the recent 20 posts on a Blogger blog label before clicking on “Older posts” to read the rest in case of this label with more than 20.
If you do not like to see them at the same time you can limit the number of posts for each label by reading the instructions below.


Log in your Dashboard blog, click Layout tab | Edit HTML and check the “Expand Widget Templates” box. Please backup your template before any change. Now, pay attention to the gadget labelIDs. If you have only one label on the blog layout, this is a keyword “id=’Label1′” for finding it out (Use Ctrl + F to show the search box):

<b:widget id=’Label1′ locked=’false’ title=’Label Title’ type=’Label’>
<b:includable id=’main’>
<b:if cond=’data:title’>
<h2><data:title/></h2>
</b:if>
<div class=’widget-content’>
<ul>
<b:loop values=’data:labels’ var=’label’>
<li>
<b:if cond=’data:blog.url == data:label.url’>
<span expr:dir=’data:blog.languageDirection’><data:label.name/></span>
<b:else/>
<a expr:dir=’data:blog.languageDirection’ expr:href=’data:label.url’><data:label.name/></a>
</b:if>
<span dir=’ltr’>(<data:label.count/>)</span>
</li>
</b:loop>
</ul>
<b:include name=’quickedit’/>
</div>
</b:includable>

When you have found, replace with code as below:

<b:widget id=’Label1′ locked=’false’ title=’Labels’ type=’Label’>
<b:includable id=’main’>
<b:if cond=’data:title’>
<h2><data:title/></h2>
</b:if>
<div class=’widget-content’>
<ul>
<b:loop values=’data:labels’ var=’label’>
<li>
<b:if cond=’data:blog.url == data:label.url’>
<span expr:dir=’data:blog.languageDirection’><data:label.name/></span>
<b:else/>
<a expr:dir=’data:blog.languageDirection’ expr:href=’data:label.url + “?max-results=10“‘><data:label.name/></a>
</b:if>
<span dir=’ltr’>(<data:label.count/>)</span>
</li>
</b:loop>
</ul>
<b:include name=’quickedit’/>
</div>
</b:includable>

Finally, save your template.

One thought on “Limit number of posts displayed in label page blogger

Leave a comment