increase / Decrease number of post show in label blogger
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:
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.
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 Hide Or Remove Showing Label In Blogger.
Enjoy!
Post a Comment