Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Is there a way to use the Facebook comment box and display the comment number dynamically?
Hi,

Shouldn't be difficult, I think.
Following are two good tutorials I came across that detail the process of integrating Facebook comments with Wordpress:
http://www.fortystones.com/facebook-com ... res-blogs/
http://techmell.com/blogging-tips/how-t ... wordpress/

The fact that the tutorials above use Wordpress is not important as the procedure is actually dictated by Facebook and should work on all sites.

Broadly these are the required steps:
1. Get an App ID/API Key from facebook (as shown in the tutorials)
2. Get the required code from Facebook to place on your site. This consists of two pieces
a. a JavaScript block
Code: Select all
<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_GB/all.js#xfbml=1&appId=YOURAPPLICATIONID”;
   fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));</script>

You can place the above code in a snippet and use cms:embed to incorporate it in your
Couch templates.
b. a piece of HTML markup to be placed where you wish to show the comments
Code: Select all
<div data-href=”http://example.com” data-num-posts=”2″ data-width=”500″></div>

Place this second piece of code in your Couch 'page-view's.
Change
Code: Select all
data-href=”http://example.com” 

to
Code: Select all
data-href=”<cms:show k_page_link />” 

And that should do it.
Do let me know if this helped. Thanks.
I was able to get it to load on my blog. I was wondering if there is a way to track how many comments have been posted via the Facebook Comment Box and display that number in the comment count section of my blog i.e 55 Comment.
4 posts Page 1 of 1