This blog has moved here: Yogeshsaroya.com | FOLLOW ME ON TWITTER @yogeshsaroya

Friday, February 24, 2012

How to use facebook comment in website


The Comments Box lets your users comment on your site’s content — whether it’s for a webpage, article, photo or other piece of content. The user can share the comment on Facebook to post to their Wall and in their friends’ streams.
In addition to providing a viral engagement boost to your site, using the Comments Box can also reduce the amount of spam comments on your site. Users will need to be logged into a real Facebook account to comment, and they won’t be able to post anonymous comments. It can makes commenting easy, since many people are probably already logged into Facebook when they arrive at your site.

Now Start :
1. Create Facebook : First Youn need do create facebook app . go Fcebook.com/apps and create app for Your website


2. Get commnet Box Code :  go here for comments  code . and get code
Copy and paste this code before </head> tag ... (make sure in all page )


and paste
data-href="http://example.com" paste Your website name here ...

But in this case You get all same comment in all page because we using  http://example.com in this code ....
Now how to change URL 
just create a function get Current Url of website like abc.com/post_1.html....abc.com/whats_new.html...


now call this function in data-href="<?php echo $object->getUrl(); ?>" (herer $object is a object of a class )
now your facebook Comment is ready and enjoy it

1 comments:

Post a Comment