If you have lots of posts it helps if you can limit the number of posts appearing in a 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:
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:
to limit the number of posts shown, just append
?max-results=5 to the link, like this:
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.
If you would like to reduce the loading time and scrolling yet at the same time show all posts, you may want to opt for Showing title only in archive and label pages.