Recent Posts

21:46:00

Assalamualaikum , tahun ni je Sya rajin nak buat entry , kalau tak nanti .. hmhm jaranglah jawapannya . amik stam kan :')

So , entry kali ni . Sya nak buat pasal "Recent Posts" . sebab apa ? sebab haritu , blog Sya ni under construction . tiba-tiba tengah edit "Recent Post"nya enggak ketemu deh. makanya , buat tutorial ini .. hahaha

1. Layout > HTML/ JavaScript
2. Letak kod bawah ni :

<ul id="recent-posts"></ul> <script> //<![CDATA[ var homePage = "http://littlesnorlax.blogspot.my/", numPosts = 5; function recentPosts(a){if(document.getElementById("recent-posts")){var e=a.feed.entry,title,link,content="",ct=document.getElementById("recent-posts");for(var i=0;i<numPosts;i++){for(var j=0;j<numPosts;j++){if(e[i].link[j].rel=="alternate"){link=e[i].link[j].href;break}}var title=e[i].title.$t;content+='<li class="recent-posts"><strong><a href="'+link+'" title="'+title+'" target="_blank">'+title+'</a></strong></li>'}ct.innerHTML=content}}var rcp=document.createElement('script');rcp.src=homePage+'/feeds/posts/summary?alt=json-in-script&orderby=published&max-results='+numPosts+'&callback=recentPosts';document.getElementsByTagName('head')[0].appendChild(rcp); //]]> </script>


3. Preview > Save
tukar lah ye ape yang patot kawan-kawan :)
Jangan lupa comment . Thanks .

You Might Also Like

0 comments

Terima kasih sebab sudi membaca entry ni :D Jangan lupa comment pulak . btw no harsh words okay ?

Popular Posts

Assalamualaikum