Welcome Here And Thanks For Visiting. Like Us On Facebook...

EXEIdeas – Let's Your Mind Rock » WordPress / WordPress Snippets » How To Get And Display Your Facebook Page Fans Counts In WordPress?

How To Get And Display Your Facebook Page Fans Counts In WordPress?

Adding a Facebook Like Button on your website or blog is perhaps one of the easiest and most effective way to get more fans and earn more likes. If you have hundreds, thousand or perhaps tens of thousand of fans, it might be a good idea to publish a fan count. Fan count displays in numeric text total fans your Facebook page has, or rather, how many have liked your page.

In the world of Internet marketing, it can really pay off to integrate your social feeds with your website. By connecting your Facebook page to your site, you have the ability to market your brand or product using more than one platform. When people begin to be invested in your brand, you have the potential to turn interested parties into paying customers. If you’re using WordPress to run your website, you have a few easy options to display your Facebook fan count on your site.

How To Get And Display Your Facebook Page Fans Counts In WordPress?

Below we are sharing the snippet to get the count of your Facebook fa page likes only in simple text without any extra data or style so that you can add your own design or style too. So copy the below code and use where you want to use it.

/* ------------------------------------------------------------------------- *
 * Get Your Facebook Page Likes Count Only
/* ------------------------------------------------------------------------- */
$page_id = "YOUR-PAGE_ID-CODE";
$xml = @simplexml_load_file("".$page_id."") or die ("a lot");
$fans = $xml->page->fan_count;
echo $fans;


You just have to change YOUR-PAGE_ID-CODE with your Facebook fan page ID that you can get by following our previous article at FaceBook Profile/Page ID-Code Finder Online Tool.

Recommended For You:
The Uses Of Robots.Txt File In SEO

Theme Files Editing Warning:

Keep in mind that every code that you will add in your themes files will be removed when you will change the theme. So after changing your theme, you have to follow this article again and you will get everything back same as it is now.

Last Words:

This is what we have and shared in easy steps for newbies so that they can easily know how it works. Stay with us because we are going to share a whole guide step by step about WordPress and make it easy for you. If you liked it then share it and be with us to get next tutorial. If you have any problem then feel free to ask us. We will help you with what we can or have.

You Like It, Please Share This Recipe With Your Friends Using...

Be the first to write a comment.

Leave a Reply

Your email address will not be published. Required fields are marked *