How to Display Feedburner Subscriber Count in Text
Don't like the Feedburner chicklet which show feed subscribers count and want a more personalized look? With this code you can show subscribers count in text format.
Don't like the Feedburner chicklet which show feed subscribers count and want a more personalized look? With this code you can show subscribers count in text format.
Open functions.php file of your theme and paste following code and Save:
function show_count($feedname) {
$url = "http://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=".$feedname;
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
$xml = new SimpleXMLElement($data);
$count = $xml->feed->entry['circulation'];
return $count;
}
Now open your desired file where you want to show feed count, let say you want to show feed count in Header than open header.php and paste the following code and Save:
<?php echo show_count(WPCookies); //Change WPCookies with your feed username or ID ?>
It will show count in raw text format, so you can style it as you like using CSS.
It can also be done without cURL.
http://wpcanyon.com/tipsandtricks/get-number-of-subscribers-in-plain-text-without-using-curl/