Menampilkan 'Total Posts dan Total Comments'.

Cara mudah menampilkan 'Total Posts dan Total Comments'.

1. Masuk akaun Blogger.

2. Pilih 'Layout'--> 'Add a Gadget'--> 'Html / Javascript'.

Copy kod di bawah dan Paste.



<script style="text/javascript">



function numberOfPosts(json) {

document.write('Total Posts: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');

}



function numberOfComments(json) {

document.write('Total Comments: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');

}



</script>



<ul><li><script src="http://NAMABLOGANDA.blogspot.com/feeds/posts/default?alt=json-in-script&callback=numberOfPosts"></script></li>



<li><script src="http://NAMABLOGANDA.blogspot.com/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></li></ul>



Perhatian !!! Gantikan text kod yang berwarna biru.

2 comments:

Post a Comment