Limit The Number of Posts in Labels Page Results

| , , ,

Limiting the number of posts appearing in a page is one way of making your blog load easily and unloading the burden of showing all post in just 1 page. It will reduce the page load time and requires less scrolling by your readers. In Blogger, you can limit the number of posts appearing on the home page, but you cannot do so on the labels page.

In this short tutorial I will show you how to put a limit to the number of posts appearing in labels page.

1. Changing the code for in-post and Labels gadget labels.
Login to your Blogger account.
Go to Dashboard > Design > Edit HTML.
Back up your template.
Tick the Expand Widget Templates check box on top right of the HTML window.

Look for following line in your HTML code:

expr:href='data:label.url'

You may find more than one instances. Replace them with the following:

expr:href='data:label.url + "?max-results=5"'

2. Changing the code for labels menu tabs
If you use menu tabs to link to label pages, the links you use are probably look like this:

http://YOURBLOGNAME.blogspot.com/search/label/YOURLABEL

to limit the number of posts shown, just append ?max-results=5 to the link, like this:

http://YOURBLOGNAME.blogspot.com/search/label/YOURLABEL?max-results=5

The codes above limits the list to 5 posts. (You change the number with your own limit).
Once the code is altered, your label pages will only show 5 posts. To view the next set of 5 posts, just click the Older Posts link at the bottom of the page.

Leave a comment

Previous

Facebook Like Box Without Footer Note

How to Make a Dropdown Menu for Labels in Blogger Blogs

Next

5 thoughts on “Limit The Number of Posts in Labels Page Results”

Comments are closed.