You Are Here: Home » Hacks » How-To » Programming » Social Media » Wordpress

Add twitter counter to a wordpress.com blog – the javascript-less version of twitter counter

By Debjit on August 1st, 2011 
Advertisement

twittercounter on digitizorHave you seen those cool chiclets which show one's count of twitter followers just like the feedburner chiclet that shows the subscriber count in a nice chicletized fashion? Anyways those cool twitter counter chiclets are a result of an awesome service from Twittercounter. To add it to your blog, all you do is go to Twittercounter’s site and enter in your Twitter username, which in turn generates some HTML that you can copy and paste. But this HTML code contains javascript and as such, it cannot be used with wordpress.com hosted blogs as wordpress.com hosted blogs donot allow javascript.

Their code, which contains javascript looks something like this:

<script type="text/javascript" language="javascript" src="http://twittercounter.com/embed/?username=Your-User-Name"></script>

So, we will present you with a simple hack that would help you to flaunt your twitter count even if you blog on a wordpress.com hosted blog. What we will be doing is to use the twittercounter source image. Even we do the same, just check this screenshot:

All you need to do is to place these img tags at the section of your website where you want your twittercounter to be placed as you would place any other image. The twittercounter chiclet is also an image after all, only that a script generates it. In the codes given below replace your-twitter-username with a username whose twitter follower counter you want to display. Here are the html codes for the javascript-less version of twittercounter alsong with the sample images that would be rendered by these codes:

<img src="http://twittercounter.com/counter/?username=your-twitter-username&style=" border=0>

<img src="http://twittercounter.com/counter/?username=your-twitter-username&style=white" border=0>

<img src="http://twittercounter.com/counter/?username=your-twitter-username&style=blue" border=0>

<img src="http://twittercounter.com/counter/?username=your-twitter-username&style=black" border=0>

UPDATE:

In case you are facing problems with the above code as in you are unable to see any images or if you have problems such as wordpress replacing your http code for the twitter counter image, then you should manually replace the curly quotes in the above links by normal quotes ( " ) and then use the URL. Thank you Morris.

Technorati Tags: twitter, count, non, javascript, version

Advertisement







Add twitter counter to a wordpress.com blog – the javascript-less version of twitter counter was originally published on Digitizor.com on March 5, 2009 - 12:44 pm (Indian Standard Time)