Inspiration For Creative Minds
Home » Labs » Code for displaying number of Facebook fans in WordPress  

Filed under Labs

In order to display the number of Facebook fans in a WordPress site just copy and paste below code to your WordPress theme. Don’t forgot to change PAGE-ID to your Facebook fan page ID.

$page_id = "PAGE-ID";
    $xml = @simplexml_load_file("".$page_id."") or die ("oops");
    $fans = $xml->page->fan_count;
    echo $fans;
It's only fair to share...Share on Google+Tweet about this on TwitterShare on Facebook

Posts you may like: