Thursday, December 26, 2013

your wordpress Comments in blog with facebook

We see it all the time to comment on the blog site is a place where you can heal your comment.
It is currently the most popular cms WordPress, we'll see how today goes to the post-season with Facebook to comment.

1. http://developers.facebook.com will go.

II. Click Apps> Create New App clicks.

comments on facebook

3. Display Name box of them to come here and give it a name without any spaces in the Namespace of the Category,
then click to select it from your blog, what kind of hours, then a popup box will appear,
create app that comes capcha leaving it to submit.

4.Then you will see app Dashboard

comments on Facebook

5. We have to go https://developers.facebook.com/docs/plugins/comments URL to comment on that app was made ​​at the url
and click here and to get code.

developers Facebook

6. Copy the code to popup it should come
Again, we go to our WordPress theme

developers Facebook

 Header.php open, including the <body> tag in the HTML code to paste.
Then the code <meta property = "fb: app_id" content = "Your App ID Here" /> header.php of the <head> tag
should be placed inside and will give the app id in place app_id.

Comments.php open again, and in this code <div data-href = "<? Php the_permalink ()?>" Data-mun-posts = "2"
data-width = "470" data-color scheme = "light" data-mobile = "false"> </ div> will be put

To open the functions.php 
function full_comment_count () {
global $ post;
$ url = get_permalink ($ post-> ID);

$ filecontent  =  file_get_contents ('https://graph.facebook.com/?ids='. $ url);
$ j son  =  j son_decode ($ filecontent);
$ count  =  $ json -> $ url-> comments;
$ WpCount  =  get_comments_number ();
$ real Count  =  $ count + $ WpCount;
if ($ real Count  ==  0 ||! isset  ($ real Count)) {
$ real Count  =  0;
}
return $ real Count;
}
Copy and paste this code.