Balkhis - Vision For Success

How to Display Feedburner count as Text with styles?

Dear Readers, I would like to thank you for reading this post. I highly value your feedback and would like to know more about my readers. Follow me on Twitter

Did you guys ever wonder, how people display feedburner stats in text? If you remember, I even did it a while back and then I took it off. Well a lot of people display it in text and have their own styling on it. In this post, I will show you how to display feedburner subscriber count as text on your site.

Why Feedburner Count as Text?

Simple, feedburner buttons are ugly. They don’t match with all the designs, and on most designs they just look ugly. This is the way you can style it and make it look like a part of a design rather than a copy and paste.

How to add Feedburner Count as Text?

This is a two step process.

Step 1

Paste the following codes in your template file where you want to display the count. And make sure you change the feed burner id from balkhis to your feedburner id.

<?php
//get cool feedburner count
$whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=rss4real";

//Initialize the Curl session
$ch = curl_init();

//Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Set the URL
curl_setopt($ch, CURLOPT_URL, $whaturl);
//Execute the fetch
$data = curl_exec($ch);
//Close the connection
curl_close($ch);

$xml = new SimpleXMLElement($data);
$fb = $xml->feed->entry['circulation'];

//end get cool feedburner count
?>

Step 2

Now paste the following codes to display the count wherever you like. Wrap it around the div tags to style it the way you want.

<?php echo $fb;?>

This will allow you to display feedburner subscriber count as text on your site. Credit of these codes goes to 45n5



To stay updated with the blog, please consider subscribing to my full feed RSS. You can also subscribe by Email and have new posts sent directly to your inbox. I hate spam as well, so I promise you that you will not be spammed.
Add to Social Bookmarks:
Add this Article to Digg Add this Article to Stumbleupon Add this Article to Del.icio.us Add this Article to Reddit Add this Article to Newsvine Add this Article to Technorati

RSS feed

22 Comments

Comment by Otooo
2008-10-05 09:36:38

Woah, that code looks tricky – lucky it’s just a copy and paste, right?
It’s good because I don’t like the default feedburner button which is why I don’t have it up on my site. so this way I can add whatever images and styling I want around it.

From yesterday’s post: I learnt some CSS today – hope to know it really well / fluently within a week :)


2008-10-07 16:14:07

That is awesome! I am going to have to get mine looking great!


 
 
Comment by Rúben M. Subscribed to comments via email
2008-10-05 09:47:38

I use a similar code since april :D i love it, i make a nice and simple background, and put in top of my sidebar :D is so cool


 
Comment by Salwa
2008-10-05 15:02:06

Well thanks for the code :) . I didn’t know this before.


 
Comment by Dr. Teeth
2008-10-05 17:25:42

that’s a nice trick syed, but it would have been much better if there were few visual examples attached.


Comment by Syed Balkhi
2008-10-05 19:16:15

Visual example of this can be found at http://www.smashingmagazine.com


 
 
Comment by Hugo Santos
2008-10-05 18:00:21

you can use the Feed count plugin to do this. Then you just need some CSS skills to make it nice :)


 
Comment by hiendgadget
2008-10-05 18:33:31

Thanks, nice tips dude :)


 
Comment by Authority Directory
2008-10-05 19:27:21

Another nice tip. I am going to think about adding this into my blog.


 
Comment by QuickPWN
2008-10-05 19:34:57

I never saw this in Feedburner before and I was wondering how other websites did that. Thanks for posting this here! Now I can change my feedburner count to text. :)


 
2008-10-06 06:22:47

OMG, this is a great post, this widgets at Burner are ugly, love the step-by-step and code, thanks so much!
JR


 
2008-10-07 22:22:55

[...] Balkhis – Syed posted a nice tutorial about how you can get your feedburner subscriber count to show up as text instead of the little ticker. This could be useful if you want to integrate it more into your [...]


 
Comment by Ganesh
2008-10-07 22:26:56

I remember seeing this at Carl Ocab’s blog. This is a cool way of displaying the feed count. Thanks for the tip.


 
Comment by Eva White
2008-10-10 00:33:08

Thanks for sharing the code.


 
Comment by Eva White
2008-10-10 00:33:53

will this work on any wordpess site?


Comment by Syed Balkhi
2008-10-10 10:29:30

Yes it should.


 
 
Comment by Christopher Ross
2008-10-11 18:17:26

Awesome tip! Feedburner is such a great resource. I’ve been guilty of not using it in the past but after some reading, I think it’s one of the best resources out there. Thanks for letting me know how to format this better!


 
Comment by ihateher
2008-10-18 10:53:17

ehm. thanks about that tips. I never know anything about that. Seems new to me.


 
2009-02-27 13:35:24

Thanks for the info and the code. Will be very useful.
Will definitely try it.


 
2009-02-27 13:37:04

Thank u for the info and the code. Your data is very useful


 
Comment by Amulekone
2009-02-27 14:49:46

Thanks for the data and the code. Will take note of your tips and apply it to my file later


 
2009-08-18 06:06:28

[...] found this tutorial on Balkhis. The original source 45n5 is no longer there. We have made it into a one step instead of a two step [...]


 

Sorry, the comment form is closed at this time.

Subscribe to Balkhis via RSS
Subscribe to Balkhis via Email Pimp My Blog