Having a Facebook Like button on website or blog is the latest trend. It is the most efficient way to expand your fan club. Publishing a fan count is advisable if you have thousands of fans as it displays numeric figure of how many people have liked your Facebook page.
To start the process, there are three essential things you will need. These are
- API key
- Application secret
- Page ID
To get API key and Application secret, you will need to sign-in to developers account. Press the button of Set up New Application. Enter the name and tap the button of Create Application. You will see the API key and Application Secret on the next page. Copy them somewhere or leave it open. Page ID is the id of your Facebook fan page.
After having these things, the next step is to download the file facebook.php. You can download it from https://github.com/facebook/php-sdk/blob/master/src/facebook.php. Put this file in the folder root.
Now to create the fan count, add the following code to the facebook.php
To display the fan count, insert the following code anywhere in facebook.php