Displaying Blogger Total Post and Total Comment Count

Displaying Blogger Total Post and Total Comment Count


Hello friends, in this article I will explain how you can display your blog's statistics on your Blogger site and how you can embed the total number of posts and total comments to your blog using these statistics.

The only thing you need to know is JavaScript

Displaying the total number of posts

<script>
function numberOfPosts(json) {
document.write('Total Posts : <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
}
</script><font color="black">
<span style="color: black;"><script src="https://urhoba.blogspot.com/feeds/posts/default?alt=json-in-script&amp;callback=numberOfPosts"></script>
</span></font>

Displaying the total number of comments

<script style="text/javascript">
function numberOfComments(json) {
document.write('Total Comments : <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
}
</script>
<font color="black">
<script src="https://urhoba.blogspot.com/feeds/comments/default?alt=json-in-script&callback=numberOfComments"></script></font>

The only thing you need to change here is to replace where it says urhoba.blogspot.com with your own blog.
As for how the system works, it pulls the information from the feed structure on how many comments and posts there are and prints it out with JavaScript.