Categories:
Cloud (204)
Entertainment (11)
Facebook (43)
General (50)
Life (31)
Programming (64)
Technology (430)
Testing (4)
Tools (488)
Twitter (5)
Wearable (26)
Web Design (44)
Collections:
Other Resources:
Facebook Comments for WordPress
Useful PHP Code Snippets for Developers - Facebook Comments for WordPress
✍: Guest
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=Your App ID Here";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<meta property="fb:app_id" content="Your App ID Here"/>
<div data-href="/<?php the_permalink() ?>" data-num-posts="2" data-width="470" data-colorscheme="light" data-mobile="false"></div>
// Get combined FB and WordPress comment count
function get_full_comment_count() {
global $post;
$url = get_permalink($post->ID);
$filecontent = file_get_contents('https://graph.facebook.com/?ids=' . $url);
$json = json_decode($filecontent);
$count = $json->$url->comments;
$wpCount = get_comments_number();
$realCount = $count + $wpCount;
if ($realCount == 0 || !isset($realCount)) {
$realCount = 0;
}
return $realCount;
}
function the_full_comment_count() {
$realCount = get_full_comment_count();
echo $realCount
}
2015-07-01, 2081🔥, 0💬
Popular Posts:
How to configure Mozilla Firefox to use Notepad to edit Web page source code? By default, when you u...
How to troubleshoot Fitbit device sync issue? My Fitbit device is connected to my Windows computer, ...
What is Web Companion that bundled FileZilla Client? Why Web Companion gets installed on my computer...
How to turn on or off comments? I have a PowerPoint presentation which has comments entered by diffe...
How to save word documents into Unicode UTF-8 text files? When I convert Word documents into text fi...