How to display Facebook fan page Like count in WordPress blog

If you want to display your blog’s Facebook fan page like count as text, simply add the following code in your theme files

<?php
$data = json_decode(file_get_contents("https://graph.facebook.com/techdreams"));
echo $data->likes;
?>

Don’t forget to replace techdreams with name or id of your Facebook fan page.

Leave a Comment

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