Tuesday, March 16, 2010

Limit Number Of Post In Labels Page For Blogger

You can set the number of posts in the main page by changing it in the Settings > Formatting > Number of Posts.








In this example, it sets it to 5 posts in the main page.





However, if you wants to set the number of posts in the labels page, it is a little tricky. But you can do it by editing some html code as listed in the tutorial below.

** Before making any changes of your template, is always a good idea to back it up.

1) Go to Layout > Edit HTML
2) Click on the Expand Widget Templates box, so you can see the details widget HTML code.
3) Find the line with this HTML in the editor, expr:href='data:label.url'
4) Add some code to make it to, expr:href='data:label.url + "?max-results=5"'
- In this case, the 5 is the limits of the labels page. You can change it to any posts limit you desire.
5) There would be more than one instance you will need to add this line.
6) Save the template and all your labels page will have the posts limit.

You will notice the labels page address will now include '?max-results=5' behind the original URL as indication of it is limiting the posts of the page to 5.

If setup correctly, you should be able use the 'older posts' and 'newer posts' link to navigate to other 5 set of posts.

1 comment:

Creator said...

Thanks,working fine.

Post a Comment