MENU


POPULAR POSTS


  • Submit News

  • FRIENDS

  • Create A Sidebar Widget To Display Your Feedburner Stats In WordPress


    .

    Posted by Daniel in Tutorials on May 10th, 2010 with 9 Comments

    If you hadn’t noticed already, we have added a nifty little sidebar widget and a post footer banner to showoff how many of you have subscribed to our blog. So today we will show you how to create your own!

    All you will require is a little knowledge of PHP and the following enabled.

    Part 1

    Executable PHP widget (If you are not running WordPress, this is not required as it works just fine without)

    Enable the Awareness API in your Feedburner settings by pressing on the Publicize tab > Awareness API > Activate.

    If you are running XAMPP or the equivalent you will need to enable CURL support in your php.ini by finding the following and removing the ;.

    extension=php_curl.dll

    Most, if not all web hosts should already have this enabled. In the off chance they do not, you will have to get in touch with them.

    Once this is all sorted you are ready to show off your Feedburner stats.

    Part 2

    Creating the Feedburner Sidebar Widget

    The CSS – This will need adding into your WordPress’s theme stylesheet.

    #show-rss {
    width:300px;
     height:125px;
     background:url(images/abstract-orange-rss.jpg) no-repeat;
     }
    
    #show-rss .rss ul li{
     padding:58px 0 0 66px;
     list-style-type:none;
     text-decoration:none;
     }
    
    .li_rss{
    
     font-size:36px;
     color:#cc6b24;
     font-family:Arial, Helvetica, sans-serif;
     }
    

    The PHP – You can either paste this into your recently installed Executable PHP widget or insert directly into your sidebar.php.

    <?php
    //Where it says YourFeedburnerID, replace with the name of your feed. For example ours is nenunocreative
    $url = "https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=YourFeedburnerID";
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    $data = curl_exec($ch);
    curl_close($ch);
    if ($data) {
     echo $data;
     //filters unwanted characters
     preg_match('/circulation=\"([0-9]+)\"/',$data, $matches);
     if ($matches[1] != 0) {
     $rsscount = $matches[1];
     }
    }
    ?>
    <a href="http://feedburner.google.com/fb/a/mailverify?uri=YourFeedburnerID" target="_blank" style="text-decoration:none;" border="0">
    
    <div id="show-rss">
    
     <div>
    
    <ul><li>
    
     <?php
     //Prints the number of Feedburner Subscribers
     echo "$rsscount";
     ?>
    
    </li>
    
    </ul></div>
    </div></a>
    

    Once you have updated YourFeedburnerID you may now post the PHP into a newly created sidebar widget as shown below:

    The last thing you need to do is just upload the below into your Themes image directory:

    And you are done! Now go check out your new Feedburner Stats Widget!

    Live Demo

    Optional

    This is optional, but if you would like to showcase your Feedburner stats at the bottom of your posts you just need to amend the CSS.

    The CSS:

    #large-show-rss {
     width:600px;
     height:125px;
     background:url(images/large-abstract-orange-rss.jpg) no-repeat;
     }
    
    #large-show-rss .large-rss ul li{
     padding:69px 0 0 300px;
     list-style-type:none;
     text-decoration:none;
     }
    
    .li_large-rss{
    
     font-size:30px;
     color:#E37A2D;
     font-family:Arial, Helvetica, sans-serif;
     }
    

    The PHP with a little HTML:

    <?php
     //Where it says YourFeedburnerID, replace with the name of your feed. For example ours is nenunocreative
    $url = "https://feedburner.google.com/api/awareness/1.0/GetFeedData?uri=YourFeedburnerID";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_URL, $url);
    $data = curl_exec($ch);
    curl_close($ch);
    if ($data) {
     echo $data;
    //filters unwanted characters
     preg_match('/circulation=\"([0-9]+)\"/',$data, $matches);
     if ($matches[1] != 0) {
     $rssount = $matches[1];
     }
    }
    
    ?>
     <a href="http://feedburner.google.com/fb/a/mailverify?uri=YourFeedburnerID" target="_blank" style="text-decoration:none;" border="0">
    <div id="large-show-rss">
    
     <div>
    
    <ul><li><?php
    
    //Prints the number of Feedburner Subscribers
    echo "$rsscount";
    
    ?></li>
    
    </ul></div>
    </div></a>

    The last thing you need to do is just upload the below into your Themes image directory:

    Open single.php and paste the mixture of PHP and HTML into where you wish the footer to show under your posts.

    Live Demo

    We offer 646-229 online training program with self paced 1z0-051 video tutorials and expert 70-685 design guides to help you learn the best design practices.


    Short url: Create A Sidebar Widget To Display Your Feedburner Stats In WordPress - http://bit.ly/JJ7hhs

    Posted in Tutorials using the Tags: , , , , , , ,

    Related Posts



    I love all things fantasy and you see that within in the content I produce for nenuno creative.

    See all posts by Daniel


    • Twitter
    • Design Bump
    • Web Blend
    • Facebook
    • Design Float
    • Reddit
    • Delicious
    • Stumble
    • Icon
    • Icon
    • Digg It
    • RSS

    Network Posts



    You can leave a response, or trackback from your own site,

    9 Responses to “Create A Sidebar Widget To Display Your Feedburner Stats In WordPress”

    1. Wow thanks for this tutorial! It will help my blog gain more rss subscribers ( I hope) as it is more attractive now :)

    2. Feedburner is really very useful for syndicating feeds from other websites.~-*

    3. widget says:

      nice widget, i hope i can use it, good article, good luck

    4. Gojeg says:

      Nice!! It works on my blog now. Thanks a lot.

    Trackbacks


    Leave a Reply


     

    All content, such as illustrations, photos, resources and tutorials are copyright to their respective owners.

    nenuno creative is a trademark of nenuno design & development network and any content or resources originally created by nenuno can't be used without permission.