Display Feedburner Subscriber Count as Text in WordPress


You probably have seen blogs that are displaying FeedBurner Subscriber count as text instead of that annoying chicklet. The ability to display the subscriber count gives you a lot of control over styling and make the count work with your design. Therefore in this article we will share a way you can display FeedBurner subscriber count as text in WordPress.

First you would need to paste this code in the template file of your choice where you want to display the text for example sidebar.php. Be sure to change your FeedBurner ID. It is the name you have after the url so wpbeginner for our site.

    <?php      //get cool feedburner count      $whaturl="http://api.feedburner.com/awareness/1.0/GetFeedData?uri=your 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'];      echo $fb;      //end get cool feedburner count      ?>

You can surround it with the styling you like.

We 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 tutorial to make less clutter.