Skip to content

Instantly share code, notes, and snippets.

@Neolot
Last active October 12, 2015 03:28
Show Gist options
  • Select an option

  • Save Neolot/3964373 to your computer and use it in GitHub Desktop.

Select an option

Save Neolot/3964373 to your computer and use it in GitHub Desktop.
WORDPRESS Счетчик лайков Facebook Page
function getFacebookCounter($pageID='225279994223146') {
$output = get_transient('facebook_counter');
if ( $output === false || $output == '' ) {
$data = json_decode(@file_get_contents('http://graph.facebook.com/' . $pageID));
$output = $data->likes;
set_transient( 'facebook_counter', $output, 60*10 );
}
echo $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment