Limit the label displayed in Blogger

Long I’ve not been here answering the questions through blog posts. Below is one of the questions incoming to my email.
Excuse me, Kang Rohman...
To display number of posts in blogspot, we can do setting in SETTINGS > FORMATTING > SHOW AT MOST> and then we fill out with a number to determine the display.
Well, how about we want to display number of posts based on the specific label? In my blog, I set the number of posts to 8 posts, but when I display the number of posts based on the specific label, all post will be displayed (not 8 post)
How could I overcome this issue?
Please send the answer to my email.
A label, when clicked, it will display all posts under the label, but we can limit the number of posts to be displayed in one page, but we have to insert a few codes to the label. The code is as below:
?max-results=5
The number 5 is the number of posts of a label to be displayed in one page. Of course, the number 5 can be replaced as you desire, but only works when we display the label manually.
The basic format of label address is as below:
http://blogname.blogspot.com/search/label/labelname

For example, Kang Rohman has a label named blog tutorial, so the address would be like this:
http://www.blogspottutorial.com/search/label/blog%20tutorial

The posts labeled under “bog tutorial” would be many, so when a visitor accesses the address, all posts will be displayed. If we want to limit the number of posts under the label, we only add the code, e.g.:
http://www.blogspottutorial.com/search/label/blog%20tutorial?max-results=5

But to add the code that is taken from Blogger database, the code would be like this:
+ "?max-results=5"
For example, if:

<a expr:dir='data:blog.languageDirection' expr:href='data:label.url'><data:label.name/></a>

The code would be like this?

<a expr:dir='data:blog.languageDirection' expr:href='data:label.url + &quot;?max-results=5&quot;'><data:label.name/></a>

Ah, Kang Rohman makes us confused clip_image001. Ha ha ha … that’s indeed for those who have known about Blogger template code. For those who are still confused, you can follow the instructions below. But, make sure that you have installed Label gadget or Category, either in the List form or Label Cloud.

  1. Login to Blogger with your ID.
  2. Click Design .

    design
  3. Click Edit HTML.

    edit html
  4. Create backup of your blog template in full by clicking on Download Full Template.

    backup template
  5. Click small box next to Expand Widget Templates.

    expand widget templates
  6. Find the code: <ul>
          <b:loop values='data:labels' var='label'>
            <li>
              <b:if cond='data:blog.url == data:label.url'>
                <span expr:dir='data:blog.languageDirection'><data:label.name/></span>
              <b:else/>
                <a expr:dir='data:blog.languageDirection' expr:href='data:label.url'><data:label.name/></a>
              </b:if>
              <b:if cond='data:showFreqNumbers'>
                <span dir='ltr'>(<data:label.count/>)</span>
              </b:if>
            </li>
          </b:loop>
          </ul>
  7. Add the limit code so it would be like this:
    <ul>
          <b:loop values='data:labels' var='label'>
            <li>
              <b:if cond='data:blog.url == data:label.url'>
                <span expr:dir='data:blog.languageDirection'><data:label.name/></span>
              <b:else/>
                <a expr:dir='data:blog.languageDirection' expr:href='data:label.url + &quot;?max-results=5&quot;'><data:label.name/></a>
              </b:if>
              <b:if cond='data:showFreqNumbers'>
                <span dir='ltr'>(<data:label.count/>)</span>
              </b:if>
            </li>
          </b:loop>
          </ul>
  8. That is for label in the list form, for label cloud, you only need to scroll down and find then code as below: <b:loop values='data:labels' var='label'>
            <span expr:class='&quot;label-size label-size-&quot; + data:label.cssSize'>
              <b:if cond='data:blog.url == data:label.url'>
                <span expr:dir='data:blog.languageDirection'><data:label.name/></span>
              <b:else/>
                <a expr:dir='data:blog.languageDirection' expr:href='data:label.url'><data:label.name/></a>
              </b:if>
              <b:if cond='data:showFreqNumbers'>
                <span class='label-count' dir='ltr'>(<data:label.count/>)</span>
              </b:if>
            </span>
          </b:loop>
           
  9. Add the limit code so it would be as follows: <b:loop values='data:labels' var='label'>
            <span expr:class='&quot;label-size label-size-&quot; + data:label.cssSize'>
              <b:if cond='data:blog.url == data:label.url'>
                <span expr:dir='data:blog.languageDirection'><data:label.name/></span>
              <b:else/>
                <a expr:dir='data:blog.languageDirection' expr:href='data:label.url + &quot;?max-results=5&quot;'><data:label.name/></a>
              </b:if>
              <b:if cond='data:showFreqNumbers'>
                <span class='label-count' dir='ltr'>(<data:label.count/>)</span>
              </b:if>
            </span>
          </b:loop>
  10. Click SAVE TEMPLATE.
  11. Done.
Happy trying!
Related Posts Plugin for WordPress, Blogger...