Home » , » List recent Posts by Label

List recent Posts by Label

8:36 AM | 5comments

Do you want learn how to  list all or your most recent posts according to categories or by labels? Well then, you’ve come to the right tutorial.I have seen people use a LinkList gadget to accomplish this.  and struggling how to list their Recent Post by label. you came to right place to learn. However this method requires them to MANUALLY add each post link to the gadget every time they publish a post with the specified label.

Step 1: Login to your Blogger account.
Step 2: Go to Design > Page Elements > Click Add A Gadget

Step 3: In Add A Gadget window, select HTML/Javascript 
Step 4: Enter a label as the title of your widget. 
Copy the code below and paste it inside the content box.

Step 5: Click Save.
HTML/Javascript Code
<!-- Recent Posts by Label Start -->
<!-- code by brought2you.blogspot.com -->
<script type="text/javascript">
function recentpostslist(json) {
document.write('<ul>');
for (var i = 0; i < json.feed.entry.length; i++)
{
for (var j = 0; j < json.feed.entry[i].link.length; j++) {
if (json.feed.entry[i].link[j].rel == 'alternate') {
break;
}
}
var entryUrl = "'" + json.feed.entry[i].link[j].href + "'";//bs
var entryTitle = json.feed.entry[i].title.$t;
var item = "<li>" + "<a href="+ entryUrl + '">' + entryTitle + "</a> </li>";
document.write(item);
}
document.write('</ul>');
}
</script>
<script src="YOUR_BLOG_URL/feeds/posts/summary/-/YOUR_LABEL?max-results=SHOW_HOW_MANY&alt=json-in-script&callback=recentpostslist"></script><span style="font-size: 80%; float:right;">Get this <a href="http://brought2you.blogspot.com/2012/03/list-recent-posts-by-label.html">widget</a></span>
<!-- Recent Posts by Label End -->
Replace YOUR_BLOG_URL in code with your own blog URL.
Replace YOUR_LABEL with the label. Labels are case sensitive, make sure you get it right.
Replace the value of SHOW_HOW_MANY with the number of posts you want to display

      Share this article :

      5 comments:

      john sheldon said...

      The deep you dig into the subject and give us the accurate data is appreciable.


      retrieve deleted files mac

      Hack2Know said...

      can we arange by old article to new article?

      mahwish iqbal said...

      "fulfill your dreams (11589)
      we gives you the easiest way to increase income
      For more details visit: http://eazy2earn.com"

      Jackery said...

      Greate work. Hi everyone. I see a template here. It is so cool. hic..But i have not enough money. Everyone can sell it for me with 15$? http://themeforest.net/item/nami-press/6166852, :(. Thanks

      Prashant gupta said...

      Hey got to Computer Tech for distint knowledge and fun :-P-> Computertechten.blogspot.com

      Post a Comment

       
      ↑ Scroll to Top