Responsive Ad Slot

Latest

latest

How to add gadget by label manage your Recent posts ?

Wednesday, November 6, 2013

/ by Umesh Shrestha
Hi friends I'm going to teach you one of simple gadget for your blog. Come with me step by step.
How to add gadget by label your Recent posts


1.1st Go to the Layout>Add a gadget>HTML/Javascrit
2.Enter the label Title On your Gadget Title.
3.Copy the below code and paste inside the content box



<!-- Recent Posts by Label Start -->
<!-- code by MeroConcept -->
<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 + '" target="_blank">' + 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_WANT TO SHOW&alt=json-in-script&callback=recentpostslist"></script>
<span style="font-size: 80%; float:right;">Get this <a href=" http://meroconcept.blogspot.com/2013/11/how-to-add-gadget-by-label-manage-your.html">Widget</a></span>
<!-- Recent Posts by Label End -->




4.Now Replace YOUR_BLOG_URL here (For example -  http://meroconcept.blogspot.com
5.Replace  YOUR_LABEL. Make sure you get it right?? 
6.Replace your value  SHOW_HOW_MANY_WANT TO SHOW  upto 100 post in same lable.
7.Above titles are bulleted due to the order list <ul> if you want them numbered you just replace ul with ol

  • If you want to add more then one gadget then not important put all Code
Just put this code on you gadget ( HTML/Javascript )

<script src="YOUR_BLOG_URL/feeds/posts/summary/-/YOUR_LABEL?max-results=SHOW_HOW_MANY_WANT TO SHOW&alt=json-in-script&callback=recentpostslist"></script>
<span style="font-size: 80%; float:right;">Get this <a href=" http://meroconcept.blogspot.com/2013/11/how-to-add-gadget-by-label-manage-your.html">Widget</a></span>


  • Make sure your first list(which contains the full code)is positioned on the top of all over list.


Happy Bloging !! :)
Back To HOME

Please like our facebook page and keep Visiting Our Blog .
( Hide )
  1. Thanks great
    Can we also get this with images/thumbnail of that particular post?

    ReplyDelete
  2. Means show image of the post also
    Thank You

    ReplyDelete

Please leave your Comment For this POST.

Don't Miss
© all rights reserved with MeroConcept
Made with By Mero Design