June 6, 2009

How to limit number of posts displayed in label page?

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 label IDs. 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, add the color 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>


The label URLs look like as follow:

http://www.myblogplus.blogspot.com/search/label/General%20tips?max-results=1

10 comments:

  1. HI,

    I had followed the procedure given above. But i could able to limit my lable tags. Kindly have a look at href="www.techdockets.com" and suggest the procedure plz.
    ReplyDelete
  2. You've just wrote a good tutorial. Nice clear tutorial .. Great job..
    ReplyDelete
  3. if u want to limit the number of labels displayed do this:
    http://www.blondmobile.com/2009/08/blogger-how-to-reduce-number-of-labels.html
    ReplyDelete
  4. after limiting label,the previous next tab gone pls help..http://www.mobilesoftzz.co.cc
    ReplyDelete
  5. thanks boss

    www.techberth.com
    ReplyDelete
  6. Hi Dears,
    I followed all the steps as discribed above in order to control the number of posts that appear in the labels but without success, every time it shows on the firs page a diferent number of posts. My blog is http://macedonia-history.blogspot.com.
    Could you help me to find where could be a problem in order to solve it.

    Thanks in advance
    Regards
    ReplyDelete
  7. Many institutions limit access to their online information. Making this information available will be an asset to all.
    ReplyDelete
  8. i too want to decrease the no. of post displayed on Final Year Project for all category can you tell how to do that.
    ReplyDelete
  9. i followed the above steps & i successfully limit my posts displayed in my Iphone apps blog labels. i bookmarked this site. Thank u!!
    ReplyDelete