Set the number of posts Display on each Blog Label Page

Set The Number Of Posts Shown On Labels Pages For Blogger
blog label

If we click on any Blogger label then we might see many posts are displaying on label pages. If you have more than 20 post under each blog label then by default blogger will display 20 posts per label page. This is not good for page loading speed. Because to display 20 posts per label will take extra time which will make your blog slower. Those who are not using any jump break on Blogger template then they will see the effect of loading time. Sometime image doesn’t load properly and even sometime page crash in loading time.

Generally the main aim to set the number of posts on each Blog label page to limit the number of post to display on label pages. You may selected 5 post per page on blog home page but when you click on label then it is displaying 20 posts. So to display same number of post per label we have to add a simple piece of code.

Add the code for Posts and Labels

Step 1 Log in to your Blogger account and Go to your Blogger Dashboard
Step 2 Click on -> Template -> Edit HTML

Step 3 Now Find the below code by pressing Ctrl+F 
expr:href='data:label.url'
Step 4 Now replace it by below code

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

Customization


  • To increase or decrease the number of post just change the 5 with 3 or 8 as you wish.

Changing the code for labels menu tabs

This section is for setting the number of posts for label menu. If you are using Custom Menu on your blog then you should also follow this tutorial. I am giving example by using my menu code. Suppose one of my label name News and I want to display 5 posts under News label.

For Example
  • http://www.bloggerspice.com/search/label/News
  • http://www.bloggerspice.com/search/label/News?max-results=5
Here my label name is News and I have added a code ?max-results=5 and now 5 posts will display under News label when a visitor will click on it.

Similarly in case of your blog the code will be like below-

Incase of Blogger BlogSpot
  • http://www.YourBlogName.blogspot.com/search/label/Label Name
  • http://www.YourBlogName.blogspot.com/search/label/Label Name?max-results=5
Incase of Custom Domain
  • http://www.YourBlogName.com/search/label/Label Name
  • http://www.YourBlogName.com/search/label/Label Name?max-results=5

Customization

  • To increase or decrease the number of post just change the 5 with 3 or 8 as you wish.
That’s it. Now you will able to limit the number of post per label. For any query drop a comment below. Thanks.  
Go Up