How To Add Total Post And Total Comment In Your Blog?


English Version
Do you know how to add Total Post and Total Comment in your blogspot / blog so it will become like below?

Total Post : 1234
Total Comment : 12345

Here is one easy way to do it.

Go to Layout > Add a Gadget > HTML/JavaScript , and paste the following code:




<script type="text/javascript">

function TotalPosts(json) {


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

}

function TotalComments(json) {

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

}


</script>


<script src="/feeds/posts/default?alt=json-in-script&callback=TotalPosts"></script>

<br/>

<script src="/feeds/comments/default?alt=json-in-script&callback=TotalComments"></script>




Save it and its DONE!



Malay Version
Tahukah anda bagaimana kita nak memaparkan bilangan Posting dan bilangan Komen di blog anda biar beliau akan kelihatan menyerupai di bawah?

Total Post : 1234
Total Comment : 12345

Ada satu cara yang mudah. Ikuti langkah-langkah di bawah:

Layout > Add a Gadget > HTML/JavaScript , dan paste kod di bawah:



<script type="text/javascript">

function TotalPosts(json) {


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

}

function TotalComments(json) {

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

}


</script>


<script src="/feeds/posts/default?alt=json-in-script&callback=TotalPosts"></script>

<br/>

<script src="/feeds/comments/default?alt=json-in-script&callback=TotalComments"></script>



Simpan dan Siap!

LaYaNLaH!!!
close