This code had been deprecated, follow this link for a more updated code.

Facebook had change their API flow to work with apps. Previous PHP code to acquire your Facebook page like count might not work anymore. The API needed access token or auth configuration of an apps for it to GET the like count of your Facebook page. Here’s a simple PHP snippet for you to get Facebook page like count without access token. Copy or add this to your custom functions.

function dez_get_the_fb_like( $fb_pagename = '' ) {
$fburl = ''. $fb_pagename;
$params = 'select like_count from link_stat where url = "'.$fburl.'"';
$component = urlencode( $params );
$urls = ''.$component;
$string = file_get_contents( $urls );
if( $string ) {
 $fbLIkeAndSahre = json_decode( $string );
 $getFbStatus = $fbLIkeAndSahre->data['0'];
 $likecount = $getFbStatus->like_count;
 return $likecount;
} else {
 return 'Data did not exist';

and use this any where in your templates or php application.

echo dez_get_the_fb_like( $fb_pagename = 'YOUR PAGE NAME NOT ID' );

Check this free WordPress plugin that have built-in social counter widgets.

Related Articles:

Optimising Your Facebook Messenger Marketing
What Were The Biggest Online Trends of 2015?
WordPress Tutorials
WordPress Developer should learn about apply_filters() and why?
Different Post Count in WordPress Search and Archive Page