{"id":592,"date":"2010-12-29T20:40:32","date_gmt":"2010-12-29T18:40:32","guid":{"rendered":"http:\/\/www.kavdesign.net\/blog\/?p=592"},"modified":"2010-12-29T20:49:22","modified_gmt":"2010-12-29T18:49:22","slug":"add-a-custom-feedburner-count-of-subscribers-in-your-wordpress-blog","status":"publish","type":"post","link":"https:\/\/www.kavdesign.net\/blog\/coding\/add-a-custom-feedburner-count-of-subscribers-in-your-wordpress-blog\/","title":{"rendered":"Add a custom Feedburner subscribers count in your WordPress Blog"},"content":{"rendered":"<p>The first thing you need to do is create a file called <em>feed.php<\/em>.  Copy the code below into the file you just created.<br \/>\n<!--more--><\/p>\n<h2>The Code \u2013  Displaying your RSS Feed count<\/h2>\n<pre>&lt;?php\r\n\/\/get cool feedburner count\r\n$whaturl=\"https:\/\/feedburner.google.com\/api\/awareness\/1.0\/GetFeedData?uri=Feed Here\";\r\n\r\n\/\/Initialize the Curl session\r\n$ch = curl_init();\r\n\r\n\/\/Set curl to return the data instead of printing it to the browser.\r\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\r\n\/\/Set the URL\r\ncurl_setopt($ch, CURLOPT_URL, $whaturl);\r\n\r\n\/\/Execute the fetch\r\n$data = curl_exec($ch);\r\n\r\n\/\/Close the connection\r\ncurl_close($ch);\r\n$xml = new SimpleXMLElement($data);\r\n$fb = $xml-&gt;feed-&gt;entry['circulation'];\r\n\/\/end get cool feedburner count\r\n\r\necho $fb;\r\n\r\n?&gt;\r\n<\/pre>\n<p>Once you have pasted this section of code into your new <em>feed.php<\/em> file, there is another important step you <strong>MUST<\/strong> take in order for it to work.<\/p>\n<h2>Input your Feedburner ID<\/h2>\n<p>On  line 3 of the code above you have to change a bit of code.  You must  change this code so that it reads your Feedburner ID instead of Feed  Here which is just a place holder.  See correct example below.<\/p>\n<div id=\"highlighter_842235\">\n<div>\n<pre>$whaturl=\"https:\/\/feedburner.google.com\/api\/awareness\/1.0\/GetFeedData?uri=ThreeStyles\";<\/pre>\n<\/div>\n<\/div>\n<p>Your  Feedburner ID is what is at the end of your Feeds URL so DO NOT FORGET  to insert that there or the feed count will not work.<\/p>\n<h2>Don\u2019t forget the Include<\/h2>\n<p>The  last step to getting your count to display is using a PHP include  statement to include the code we copied above into the actual page.  On  my blog I included my code into the sidebar because that happened to be  where I had space. So in my <em>sidebar.php<\/em> I used the code below.<\/p>\n<div id=\"highlighter_342739\">\n<div>&lt;?php include(&#8220;feed.php&#8221;); ?&gt;<\/div>\n<\/div>\n<h2>Time for the Styles!!<\/h2>\n<p>Now we have our code coming into the sidebar but it is as plain as plain can be right?<br \/>\nRemember I\u2019m doing this tutorial based on the subscribe button in the  top right corner of the sidebar.  So first I am going to open my <em>sidebar.php<\/em> file or whatever file you placed the Include statement in.  We are now  going to add two divs around our include statement as shown below.<\/p>\n<div>\n<pre>&lt;div id=\"feedcount\"&gt;&lt;a href=\"http:\/\/feeds.feedburner.com\/ThreeStyles\"&gt;&lt;\/a&gt;\r\n &lt;p&gt;&lt;?php include(\"feed.php\"); ?&gt;&lt;\/p&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\n<p>Original post from:<\/p>\n<p>http:\/\/www.threestyles.com\/tutorials\/add-a-custom-feedburner-count-to-your-wordpress-blog\/<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The first thing you need to do is create a file called feed.php. Copy the code below into the file you just created.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[9,82],"tags":[156,157,154,155,418],"class_list":["post-592","post","type-post","status-publish","format-standard","hentry","category-coding","category-wordpress","tag-count","tag-custom","tag-feedburner","tag-subscribers","tag-wordpress","entry"],"_links":{"self":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/comments?post=592"}],"version-history":[{"count":10,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/592\/revisions"}],"predecessor-version":[{"id":602,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/posts\/592\/revisions\/602"}],"wp:attachment":[{"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/media?parent=592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/categories?post=592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kavdesign.net\/blog\/wp-json\/wp\/v2\/tags?post=592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}