Are you getting tired of all those boring, run-of-the-mill Feedburner chicklets? I know that I am.
I love visiting professional blogs that have taken the time to integrate their number of Feedburner subscribers into their template in a way that is both unique and visually appealing… like this site.
A couple of weeks ago, I took the time to explain how to Display Your Twitter Followers as Text. As a result of that article I received a lot of requests to explain how to do the same thing with Feedburner subscriber counts.
Step 1 – Get The Number from Feedburner
In this first step, you are going to place the code into your site that is going to contact feedburner and get the number. It will then store it in a variable that we will display in the second step.
To begin just copy-and-paste the following code into your theme somewhere.
Be sure to replace ‘feedburner-id’ with your actual feedburner id.
//get cool feedburner count $whaturl="https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=feedburner-id"; //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 – Display The Count In Your Theme
To display the number that we have stored in the variable just paste the following code into your theme in the location where you want to display the feed count.
Using WordPress? Here’s the Quick and Easy.
First, install Feedburner Circulation plugin.
Second, paste the following code into your blog’s theme wherever you want it to display.
<?php feedburner_circulation_text('feed_id'); ?>
That’s it. It might look complicated, but it’s not. Just read it over slowly and let me know if you have any questions.