Templates By,

Style

Features

Color

Template Or Plug-ins ?

There is a button like a feedburner count button for Twitter Follower Count. If you want to display your twitter count as text, follow this instructions

First of all you must create file named twitter.php and paste the following code in there:


<?php
$tw = get_option("twitterfollowerscount");
if ($tw['lastcheck'] < ( mktime() – 3600 ) )
{
$xml=file_get_contents('http://twitter.com/users/show.xml?screen_name=wpboxblog');
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) {
$tw['count'] = $match[1];
}
$tw['lastcheck'] = mktime();
update_option("twitterfollowerscount",$tw);
}
echo $tw['count'];
?>

Make sure you've replaced 'wpboxblog' with your twitter username.

Now you can paste this code anywhere you want to show Twitter Follower Count as Text

<?php include("twitter.php"); ?>

Leave a Reply

Related Posts Plugin for WordPress, Blogger...