Update: Better Code Display Twitter Counter Text using WordPress Api
Display Twitter Counter in Text is easily in WordPress with PHP code, all need to do just write down some PHP Script in our wordpress theme, we can write it on sidebar.php, footer.php, header.php or whatever we want to put on.
This code is similar with our previous tutorial about display FeedBurner counter in text, but we need to change some code, because the source is different, we still use file_get_contents() functions, this functions is the some function that we use to modified TimThumb Script to make it work on some server problem. So, let’s get started
Write down Display Twitter Counter in Text code below
<?php
$twit = file_get_contents('http://twitter.com/users/show/USERNAME.xml');
$begin = '<followers_count>'; $end = '</followers_count>';
$page = $twit;
$parts = explode($begin,$page);
$page = $parts[1];
$parts = explode($end,$page);
$tcount = $parts[0];
if($tcount == '') { $tcount = '0'; }
echo '<div class="twitter-badge"><strong>'.$tcount.' </strong> Followers</div>';
?>
Replace USERNAME with your own USERNAME, example our Twitter username is @WPTricksNet (you can follow it if you want
That’s all, save your code and test it… I hope tutorial display Twitter Counter in Text work like charms just like our FeedBurner Counter in Text tricks too. Thanks for Webm.ag for share, via ThemeGamag Don’t forget to subscribe our RSS
Update: Better Code Display Twitter Counter Text using WordPress Api



Pingback: Mostrar el Numero de seguidores de Twitter en Wordpress | Recursos para Diseñadores Gráficos y Web | Creativos Online
I was searching google and other search engine and I found this solutions on this site… this is super tutorial..
thanks for share
Wonderful Twitter Tricks, I was try to find out this code for a while.. and we got it here
When will google buzz overtake twitter?
I think it’s will never happen.. Google Buzz it’s look like similar with Twitter… but it’s different…. Buzz is more thatn 140 Character… it’s Feed syndication from many many services included Twitter…
Pingback: The Ultimate Guide To Wordpress Hacks And Customizations | pro2go Designs Blog
Pingback: Wordpress Hacks e Customizations! | sinergie.::.websolution | il blog
Great tip. Thanks for sharing
Pingback: sinergie.::.websolution » Blog Archive » Wordpress Hacks e Customizations!
Why not create a plugin for that? A lot of people are not familiar with php coding and how to run that code.
Really nice tips.thanks for your help, man!
Go on with it!
Thanks, this is the only twitter code I’ve gotten to work.
Hey guys, there is a simpler option that prints out the Twitter follower counter as plain text for WordPress blogs.
I’ve developed a plugin that does that with an extra: you know how if Twitter is offline (fail whale) or it is slow, and how it impacts on your site, making it slow too?
I’ve figured out a way to solve that by simply creating a cache. If Twitter is down, you still get your followers shown as it grabs the last known number of followers.
Pretty neat, huh? Just check out the WordPress Plugin Directory for “Twitter Counter Cache-rizer”. Easy to install and works just fine!
Here’s the link if you’re interrested:
http://wordpress.org/extend/plugins/twitter-counter-cache-rizer/
Hope it helps someone out!
By the way, awesome blog design! I loved this wooden theme!
Pingback: Mostrar el numero de tus seguidores en Twitter | Blog de Miguel Chang
Pingback: wp-popular.com » Blog Archive » How To Display Twitter counter in Text # WordPress Tricks & Tips
Thank you this twitter counter works great on my site. I will recommend it to my blog partners..
hi, thank you for the code, really very helpful.
anyway, how do we display the number of friends or twitter accounts followed on my site/blog?
thank you, i truly appreciate it.
Cool tutorial. Will be cool to get a twitter counter on my blog.
Really cool tutorial. I was searching for it. I am searching for a plugin to display both twitter counter and rss feed reader counter, though.
Great tip, it’ll help me.
nice trick. =D
Pingback: The Better Way Display Twitter Followers in Text # WordPress Tricks & Tips
Pingback: How To Autolink on Twitter Username | WordPress News Wire
Pingback: Welcome to WPTricks.net | WordPress News Wire
Pingback: How to Display Twitter Counter in Text | Fazreen
another great related post plugin is nRelate. I’m sure it will be great! thanks for the tutorial