This kind of desire can be realized in several ways, including us as owners of the blog attempting to display popular post widget, recent post, related articles, recent post and others. with the editor widget-widget at least the visitors involuntarily can see several titles of posts that appear on the widget-widget.
Well, this time the Blog Guidelines attempt to provide guidelines for making a recent post. Recent post that I give is very simple and light, and also how to make it simple. Let's start how to create simple recent post on blogger:
(1) how are you already logged in? If not, please log in to your blogger account
(2) Layout
(3) Add a Gadget
(4) HTML/JavaScript then Add
(5) Insert the following code
<script>
//<![CDATA[
function showlatestposts(json){document.write('<ul id="recent-posts">');for(var i=0;i<7;i++){var entry=json.feed.entry[i];var posttitle=entry.title.$t;var postsurl;if(i==json.feed.entry.length)break;for(var k=0;k<entry.link.length;k++){if(entry.link[k].rel=='alternate'){postsurl=entry.link[k].href;break;}}
document.write('<li class="recent-posts">');document.write('<a href="'+ postsurl+'" target ="_top" title="'+ posttitle+'">'+ posttitle+'</a>');document.write('</li>');}
document.write('</ul>');};
document.write("<scr" + "ipt type="text/javascript" src="/feeds/posts/default?orderby=published&alt=json-in-script&callback=showlatestposts"></scr" + "ipt>");
//]]>
</script>
(6) save, and see the results
0 Komentar