Advertisement
utnalove

fb comments

May 1st, 2013
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. function full_comment_count() {
  2. global $post;
  3. $url = get_permalink($post->ID);
  4.  
  5. $filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $url);
  6. $comments = file_get_contents('https://graph.facebook.com/' . $id . '/comments?summary=true');
  7. var_dump($comments);
  8. $json = json_decode($filecontent);
  9. $count = $json->$url->comments;
  10. $wpCount = get_comments_number();
  11. $realCount = $count + $wpCount;
  12. if ($realCount == 0 || !isset($realCount)) {
  13.     $realCount = 0;
  14. }
  15. return $realCount;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement