35 Outstanding free twitter backgrounds

How to show Twitter Followers Count on wordpress widget

We all are having the twitter account. If we want to show Twitter Followers Count on wordpress widget then just use our code.

How to show Twitter Followers Count on wordpress widget

Open your sidebar.php file and just copy paste the following code.

First you would need to create a file twitter.php and paste the following code in there:


<?php

//This xml file will return the all user information about from twitter account
$xml=file_get_contents('http://twitter.com/users/show.xml?screen_name=wordpressapi');
if (preg_match('/followers_count>(.*)</',$xml,$match)!=0) {
$twitter_follower_count['count'] = $match[1];

// this will show the twitter followers count
echo $twitter_follower_count['count'];
?>

WordPressapi is my twitter username. So you can change it your username.

Published by

Purab

I am Purab from India, Software development is my profession and teaching is my passion. Programmers blog dedicated to the JAVA, Python, PHP, DevOps and Opensource Frameworks. Purab's Github Repo Youtube Chanel Video Tutorials Connect to on LinkedIn

Leave a Reply

Your email address will not be published.