Set The Number Of Posts Shown On Labels Pages For Blogger

Posted : Wednesday, May 18, 2011 |Β  Post Author : Paul Crowe |Β  71 comments

number-posts-per-label-bloggerIn a recent post i showed you how to have your blogs labels displayed in a drop down menu.A comment from APF in that post remarked “I’d prefer to see a drop-down that honors the limit (in my case, 1) number of posts per screen I’ve set for blogger in general”.What APF is referring to here is he has set his blog to display one post per page, so on the home page of his blog there will be only one post.Then the Older Posts, Newer Posts links are there for people to navigate through other posts.You can set the number of posts per page on your blog in your settings under formatting.This works fine on the home page and with the older, newer links but when someone clicks a label the limit is not applied, in this post i will show you how to fix that.

So APF wants only 1 post to be shown when someone selects a label, by default all posts will be shown.This is a bit of a mess, you can end up with 20 full posts loading or even crashing if you have large posts with no jump break.On Spice Up Your Blog i have 12 posts per page and i want the same on my labels page here is how it’s done.

Take a look at the default link for the label Gadgets here on SUYB, if you click it you will get a big list of posts with that labelΒ  :

http://www.spiceupyourblog.com/search/label/Gadgets

Now in this link i have set it for only 2 posts to be shown with the older, newer links to see more :

http://www.spiceupyourblog.com/search/label/Gadgets?max-results=2

The actual number i have applied is 12, the same as the home pageΒ  which you will see every time you select a label.So lets see how you can set a limit to any number of posts you choose.

Set Fixed Amount Of Posts Displayed On Labels Pages

Step 1. In Your (New Design) Blogger Dashboard Click The Drop Down Menu For Your Blog > Choose Template > Then Edit Html > Now Proceed > Tick The Expand Widget Templates Box as shown in the video Below :

Step 2. Find the following code in your blogs html – it will be in your template a few times :
(Click Ctrl and F for a search bar to help find the code – More Info)

expr:href=’data:label.url’

Step 3. Replace them all with the following code :

expr:href=’data:label.url + “?max-results=6″‘

Important – Highlighted is the number of posts displayed, it’s set as 6.Replace the number 6 with the number of posts you want displayed.

Linking Directly To Labels

So that will set a number of posts to be displayed in the links automatically generated.By automatically generated i mean labels in a labels gadget in your sidebar or above/below your posts.What if you are adding manually adding labels links to a post, menu or elsewhere ?

Simply add ?max-results=6 to the end of the URL, changing 6 to the number you want.

So this :

http://www.yourawesomeblog.com/search/label/awesome

Becomes This

http://www.yourawesomeblog.com/search/label/awesome?max-results=6

That’s it your labels pages now have a fixed number of posts displayed.

Drop Your Comments And Questions Below.

71 comments:

  1. Yes yes yes finally found how to do it ! thanks soooooo much…

    ReplyDelete

  2. hi i can’t find (expr:href=’data:label.url’) this in my blog i ticked expand widget but i can not find it please help

    ReplyDelete

  3. LovefortechnologyMay 18, 2011 at 9:14 PM

    Thank you, I would like to ask how we can reduce the number of posts when turn on the Blog Archive.

    ReplyDelete

  4. @ Suprim – I checked out your blog and you have this already set at max as 7.So either you found it or it was already set in the template.

    ReplyDelete

  5. Wow thax that really helped.

    ReplyDelete

  6. hi paul in my template i hav two code like this
    expr:href=’data:label.url’
    and it’s not workin please check my blog and give me idea how to show on my blog

    ReplyDelete

  7. dude now it’s workin in my blog
    http://smahkin.blogspot.com/search/label/GAMES?max-results=6

    ReplyDelete

  8. Ok thanks

    ReplyDelete

  9. @ Suprim I can’t seem to find expr:href=’data:label.url’ in my blog. I’ve searched through it manually and also with the “Find” control.
    http://links4pk.blogspot.com/

    ReplyDelete

  10. @ Usman – What is the URL of the blog, just add the URL don’t make it a link.

    ReplyDelete

  11. sorry for bad english:

    Dear i don’t know what is the difference between url and link.
    and i have one more problem my blog width is increase due to blogger maintenance few days before. please you visit my blog and give me suggestion for how can i fix this problem..

    Screenshot:
    http://img12.imageshack.us/img12/9163/capturelkm.png

    ReplyDelete

  12. I Like Your Blog Very Much:)
    When Ever I Search On Google For Any Kind of Blogger Help
    I Choose Your Blog πŸ™‚

    ReplyDelete

  13. Great, thank goodness I can limit the number of post in my label.

    But I have another problem; I use a custom template and I limited the number of post to be displayed in my blog to 5. It actualy worked, but only on the forst page, when you click next to the second page, it would display 10 post and surprisingly, because I limited to 5 post, the number 6, 7, 8, 9 & 10 post that should have been displayed on the first page wont appear on the second page.
    Based on this, I limited it to 10 post per page so as to show all my post, but doing so resulted in a longer loading time. Please, Please, Please help me out, is there a place in the “edit template” I can do this.

    Please help.

    ReplyDelete

  14. i have experiment in my blog,succeessfully..Thanks Mr

    ReplyDelete

  15. thanks for the tips πŸ™‚
    nice post πŸ˜‰

    ReplyDelete

  16. It doesn’t work.. My template is Picture window.. Please Help me!!! πŸ™

    ReplyDelete

  17. Thanks for the info…but how can I edit the size of image in the result page of labels?

    ReplyDelete

  18. Thanks for sharing, was looking for this

    ReplyDelete

  19. thank you so so much. It works like a charm.

    ReplyDelete

  20. Thanks for sharing..
    I want to try it..

    ReplyDelete

  21. On the label, it does appear “http://angiesrecipes.blogspot.com/search/label/Nuts%20and%20Seeds?max-results=12”, but it just shows 11…and I clicked the older pages…another 11…
    What could be the problem?

    ReplyDelete

  22. p.s on “formating”, I did set up 12 posts on the main page.

    ReplyDelete

  23. Hi
    please i need your help , i want to change posts number on my second page , at home page i have 10 posts apear but in second page just 4 i want 10 , plez help
    Thank’s

    ReplyDelete

  24. Jokes : Unlimited FunFebruary 3, 2012 at 1:51 PM

    thnx bro… dis really helps…

    ReplyDelete

  25. funwithpuzzles.comMarch 2, 2012 at 12:18 PM

    Thanks!
    This was really helpful.

    ReplyDelete

  26. finally a great fix…..!!!

    ReplyDelete

  27. Are there any valid alternatives for the new Blogger interface..? Thanks!

    ReplyDelete

  28. Mohammed Sohail KhanApril 10, 2012 at 7:17 AM

    Please help me my blog is showing 1 or 2 posts on the main page i have 6 posts total where are the other posts. I want to show 10 posts on the main page i have set it in the posts options but still not showing my blog url is http://wicket99.blogspot.com

    ReplyDelete

  29. Its not used in my blog
    is there any restrictions for this trick
    like it can be only usedin blogeer templates

    ReplyDelete

  30. Wolston @Romantic smsApril 25, 2012 at 3:37 PM

    I did this successfully on my website. What about?max-results=5″ appearing on search results? Will that affect SEO?

    ReplyDelete

  31. it works, thanks.

    ReplyDelete

  32. good posting…thanks for sharing

    ReplyDelete

  33. Thanx Paul, You are the master of blogger. It’s working great.

    ReplyDelete

  34. this is broken for my blog, its working on main the page but on category its still shows the “older post” navigation and when i click on that, thats the time this page number shows up

    ReplyDelete

  35. Kristin AquariannJune 30, 2012 at 2:45 AM

    Your tutorial worked great. Thank you so much!!

    ReplyDelete

  36. It’s not work for my blogger homepage, but it worked from next page. This is my blogger website : http://earningononline.blogspot.com/ Please tell me how can I solve my problem?

    ReplyDelete

  37. my blog address appears like this

    http://winmaclin-wallpaper.blogspot.in/search?updated-max=2012-07-15T02:04:00%2B05:30&max-results=50

    my post are not being displayed only 5 newer posts are displayed on home page plz help me out here… thanks in advanced plz do reply soon i m stucked…

    ReplyDelete

     

    Replies

     

  38. ur problem solve or not ?
    Because i have save problem

    Delete

  39. I have the same problem!
    What should I do? Please help!

    Delete

  40. I have the same problem!
    What should I do? Please help!

    Delete

  41.  

  42. Ouwwh yes! πŸ˜€ after so long time xD finally I found it here πŸ˜€ thanks for share πŸ˜€

    ReplyDelete

  43. yes this works in my blog

    ReplyDelete

  44. yyyess it is working in my picture window template
    thanks

    ReplyDelete

  45. Thanks, this is work πŸ™‚
    I wonder why trivial things like this go unpunished by the fact blogspot blogger under google support.

    ReplyDelete

  46. Actually I Already Know About This. I Want To Know How To Apply This Feature To Search Result In Blogger To Make Blog More Professional πŸ™‚

    ReplyDelete

  47. problemo solve. thanks for sharing

    ReplyDelete

  48. Thanx a lot Paul. It rele worked on my blog. Keep going.

    www.entertainmentinfo.in

    ReplyDelete

  49. How do I make my blogger show all my posts on one page?

    ReplyDelete

  50. Hey man its works like a charm

    ReplyDelete

  51. Great Thank You So Much!..

    ReplyDelete

  52. amazing post i works amazing

    ReplyDelete

  53. Hi! I want 10 posts to show on my homepage, but only 5 show. I did exactly what you said. But it’s not working. I also tried to configure my blog using Settings, but it’s still not working. Maybe it’s automatically configured, but I don’t know how to determine that. Do you know how to fix this problem? Thanks for your time.

    ReplyDelete

  54. Thanks Admin,You Really Helped Me(y)

    ReplyDelete

  55. I find expr:href=’data:label.url but I got error when added + “?max-results=6″‘.

    What should I do?

    ps. I have 5 posts in a … label and I want to show 4 posts per page.

    ReplyDelete

  56. thanks one more time as i have already thanked you for making my blog wonderful by default no of posts were 7 in my blog and now i have been able to set it upto 10 from your tips.Thank you for great blogger help.

    ReplyDelete

  57. well i find 6 results of this and when i change all of them nothing happens.
    ps. i dont know what is going on . some labels have (link)
    max-results=20&start=16&by-date=false
    others
    max-results=20&start=12&by-date=false

    can you help me?

    ReplyDelete

  58. does this work automatically somehow? It makes no sense to edit the template. No effect. Only when I made the custom links it worked. Any way to make this work with the default labels?

    ReplyDelete

  59. it couldn’t work for me .. i want to all of all posts in label, how it is possible please help …

    ReplyDelete

  60. I can’t seem to find the expr:href=’data:label.url’ thingy on my blog www.trynottolaughorgrin.com please help!!!

    ReplyDelete

  61. The Blog you are running is just awesome. The stuff and theme of the blog is so impressive. The actual match, like your blog, is found on very rare places. This blog is so clear and simple, there is no useless content you have added just to show a fake knowledge about the topic. I am new to blogging and picking lot from your blog. Here is my blog if you want to take a look and do suggest me if any problem or something missing.
    Thanks a lot!!!

    http://www.applicationf1.com

    ReplyDelete

  62. Thanks for sharing..

    ReplyDelete

  63. www.dasathanews.comApril 29, 2013 at 8:15 PM

    Yep…. it is working bro..
    Thank you very much for sharing…

    ReplyDelete

  64. Finally I got the result. Thank you so much.

    ReplyDelete

  65. I applied it to my blog and it worked.Thanks for such type of post. keep it up.

    ReplyDelete

  66. tutor tested 100% work…. thanks…

    ReplyDelete

  67. thank you very much

    ReplyDelete

  68. work like a charm.thanks

    ReplyDelete

  69. Outstanding, worked like a charm!!

    ReplyDelete

  70. hi, my blog is www.ehowto.in. i am able to set 9 blog on home page only. please tell me how to set 20 blog on home page. thanks

    ReplyDelete

  71. Thanks dude! It worked!!

    ReplyDelete

  72. “GOD” Bless
    Thank a lot

    ReplyDelete