we will discuss how to create a new article based label widget.
For those of you who want to install the widget on the blog, please read and follow the following steps:
1. Log in your blogger account.
2. --- Choose Layout> Add a Gadget ---> HTML / JavaScript.
3. Copy the following code in HTML / JavaScript.
<script style="text/javascript">
var numposts = 9;
var standardstyling = true;
</script>
<script type='text/javascript'>function showrecentposts(json) {
for (var i = 0; i < numposts; i++) {
var entry = json.feed.entry[i];
var posttitle = entry.title.$t;
var posturl;
if (i == json.feed.entry.length) break;
for (var k = 0; k < entry.link.length; k++) {
if (entry.link[k].rel == 'alternate') {
posturl = entry.link[k].href;
break;
}}
posttitle = posttitle.link(posturl);
if (standardstyling) document.write('<li>');
document.write(posttitle);}
if (standardstyling) document.write('</li>');}</script>
<script src="http://NAMESBLOG.blogspot.com/feeds/posts/default/-/NAMESLABEL?orderby=published&alt=json-in-script&callback=showrecentposts&max-results=500"></script>
Description:
NAMESBLOG: Replace with your blog URL.
NAMESLABEL: Replace with the name of the label that will be displayed.
var numposts = 9: Number of posts to be displayed in the widget.
4. Then click 'Save'.