Monday, May 28, 2012

Add Social media widget with count to Blogger and Wordpress blogs

Posted On 2 comments Follow us on twitter

Twitter, Facebook

You may see many social widgets around the web; we are sharing one of them. This is one of the best social media widgets (I think so) with this widget you can add link to your social profiles as well as you can show the total count of Twitter followers and Facebook like (or) fan count as a text and more to come.
This widget is not new, while browsing MOHAMMAD MUSTAFA AHMEDZAI, my blogger tricks (mbt) blog, I see this widget, but in that widget you have to manually add count and in this widget you don’t need to add manually, it will be added automatically through these social networks API. This is simple widget based on JavaScript, jQuery.


social media widget count

First of all you need HTML and CSS, here it is:
.counter.pattern {padding:4px}
.counter.pattern .content {padding:5px}
.counter{ color:#333; display:block; float:left; line-height:14px; text-align:center; text-decoration:none; width:30px;margin:0 10px 0 5px}
.counter img{margin:2px 0 5px}
.counter .count{ font-family:CabinMedium,Calibri,sans-serif; font-size:14px; font-weight:700 }
.counter span{ font-family:CabinCondensed,Calibri,sans-serif; font-size:11px; letter-spacing:2px }

<a rel="nofollow" href="Your Facebook Page Url" class="counter pattern">
                            <div class="content">
                                <img alt="facebook icon" src="" /><br>
                                <span class="count"><div class="facebookFollowers"></div></span>
                                                            <a rel="nofollow" href="Link to Your Twitter ID" class="counter pattern">
                            <div class="content">
                                <img alt="twitter icon" src="" /><br>
                                <span class="count"><div class="twitterFollowers"></div></span>

<script src='' type='text/javascript'></script>
$(document).ready(function() {
$.getJSON(' facebook page id or username', function(data) {
  $('div.facebookFollowers').text(data.likes + 1 + ' ');
$.getJSON(" Twitter id", function(data) {
  $('div.twitterFollowers').text(data.followers_count + 1 + ' ');
<!-- Followers Count -->

Replace Your Facebook Page Url with your Facebook page url.
Replace Your facebook page id or username with your Facebook id or user name.
Replace Link to Your Twitter ID with link to your twitter id.
Replace Your Twitter id with your twitter id.

Now I show you step by step tutorial how to add to Blogger and Wordpress Blogs.  

Adding to Blogger / Blogspot blogs:

1. Login to your account.
2. Go to Blogger Dashboard.
3. Select layout from your blog's drop down menu.
4. Add new gadget by clicking add a gadget.
5. Select HTML / JavaScript
6. And paste html code listed above.
7. Done

Adding to Wordpress Blog:

1. Go and login to admin dashboard.
2. Select widget from appearance.
3. Add a text based widget and paste above html code.
4. Done.


  1. This is nice and very wonderful.
    Thank you for this tutorial I love it

  2. Is there a way to add Google+ page followers as well?