Blogger Widget: Show Total Posts & Comments

How to Restore Pencil to Edit Posts

You might have noticed that some Blogger blogs have widget installed in the sidebar which displays total posts and comments of that blog. Well, you can also install such a widget in your blog as well. A simple script allows us to show off total posts and comments on our blog.

Steps to Add the Widget!

  1. Go to Layout | Page Elements.
  2. Click Add a Gadget link in your sidebar where you want to add this widget.
  3. When a new window is opened, chose HTML/JavaScript as your widget and add the following code in the Content field.
    <script style="text/javascript">
    function numberOfPosts(json) {
    document.write('Posts: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
    function numberOfComments(json) {
    document.write('Comments: <b>' + json.feed.openSearch$totalResults.$t + '</b><br>');
    <font color="blue"><script src=""></script>
    <script src=""></script></font>

  4. Save your widget and see the blog.

Widget Customization!

Replace with your own blog URL. You can change the Posts: and Comments: text to whatever you like for example you can replace Comments: with Total No. of Comments:.


  1. @ Dorothea, help me improve this blog by making some suggestions.

  2. Lovely widget. But the blue text doesn't look harmonious with my blog. Any simple way i could make it green? Thanks in advance!
    My blog:

  3. Hi Magali, whoa this is so simple. In the above code, just change:

    <font color="blue">


    <font color="green">

    and now you'll have the text in green!

  4. ThanX
    I use this widget on my urdu language blog..... very nice and helpful


Note: All comments will be moderated.