Tuesday, July 3, 2012

How to Reduce the Number of Posts to Show Under Labels Menu Tabs

Blogger blogspot allows you to set the maximum number of posts that you would like to be displayed on your homepage but this only affect the posts but not the labels. Incase you use labels menu tabs to show different posts links the way I have done in this blog,  I guess you have already observed that, when you clicks on the menu tab, a long list of posts falling under that label are displayed. This increases the loading time of the page and the audience has to spend much more time scrolling down the page.

This is example of how my label menu tabs looks like. When I click on the home tab or any other tab, a list of all posts under that label are displayed.


Incase you want to reduce the number of posts under a specific label menu tab, here is a simple tutorial on how to go about doing it.  Go to;
  • Blogger - Dashboard - Design - Edit HTML (make sure that you save your template before editing anything).
  • Check on Expand Widget Templates.
  • Using Control + F, find the following code expr:href='data:label.url' (Note that you will find more than one code).
  • Replace them all with the following code; expr:href='data:label.url + "?max-results=5"' 

Save your template. If you check your blog and click on any label menu tab, you will only see a list of 5 pages under that label. To see more posts, click on older posts.
 

3 comments:

  1. This was helpful. Thanks a lot

    ReplyDelete
  2. why i cant find the expr:href='data:label.url'

    ReplyDelete
    Replies
    1. If you cannot find it using the code that I have listed above, locate it by using the following code; . You will find it just below the above code.

      Delete