Hi
we are pondering using the FB comments plugin generated from FB dev site (not WP comments ‘plugin’).
Trick is
a) putting the required div and javascript after body, ONLY on post template — not the header file … we use template 2 as default for posts
b) have to insert the function call for FB comments below the post — tricky with the single post file, single template file, and single loop file, for correct spot ( I tried and got server error, so obviously … duh …)
c) need to remove the “number of comments” element in the single post template, since it cannot count from the FB comments
d) in our version of theme we still get the “NO COMMENTS Comments are closed.” element at bottom of posts, so need to hide that, obviously.
Anybody who has done this with Newsmag would love some feedback on both how to hack this and also any performance issues (aware of the cookies and junk sent by FB, but with local comments on, we get no comments; with Disqus on we get comments, but some folks hate that — so, FB comments getting more and more common, so thought we’d try it …)
Thanks all! 🙂
Hi Chris,
I haven’t implemented FB’s comments to the theme so I cannot give you any guidance on this but if you want us to take a look please write us via email and include all necessary info so we can check this and, if you consider necessary, the admin login details.
Thanks
Hey guys is there an update on this? We too would love to use Facebook Comments. We are noticing a large number of spam comments with the generic comment section, we are hoping not only will the comments be optimized on facebook, but it will also limit the spam comments. Thank you for your insights.
Hi, all.
I will email Lucian/Radu the example stuff.
But quick overview…. FB has their own generated code you can implement, which can be responsive and this method basically replaces their old defunct WP plugin for FB comments.
Example in action on IMDB news items:
http://www.imdb.com/news/ni59489163
But, basically you go here:
https://developers.facebook.com/docs/plugins/comments
You use the “configurator” to specify a website, and width such as “100%” for responsive divs.
Assuming your site is already setup for ‘apps’ in your FB developer/user account, you would on above page click the ‘get code’ and then it will ask you to assign to one of your sites (if more than one), and you have a block of code to use with a WP theme.
Block ONE, looks like this and would go after the body tag on POST template:
<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/sdk.js#xfbml=1&version=v2.5&appId=XXXXXX";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
then block two would either replace the comments box includes file, or simply be pasted into the template for the post, after post loop, after author box
<div class="fb-comments" data-href="http://mydomain.zzz" data-width="100%" data-numposts="5"></div>
Only trick is when you do the form, then get code, it will say “item not public, make public on your app menu” then trick there is to put in email, namespace (sitename all lower case), domain for app. Then click to make public. Going back to the configurator doesn’t make a new app, you’re still making just the ONE app for your site you specify; you can’t make 2 accidentally!
This came up due to not getting many comments with the default commments after switching off DISQUS due to problems (apparently a number of plugin devs working with Disqus complaining of lack of response to issues, so not sure if they are restructuring or on the way out, or what).
Not all sites benefit from comments, but some do. We have couple of sites where they are useful, and others we have just now turned them all OFF as waste of space and spam magnets which also artificially boost page views from the spammers hitting the pages to post comment spam.
Anyway… that’s where we’re at so far …
I would definitely be interesting in implementing Facebook comments. I dislike Facebook and rarely ever use it, but I understand that virtually everyone has a Facebook account and that makes the Facebook comment system seem practical. However, while I’m currently taking a couple intro coding courses on Udemy, I feel like I’m far from being at the level of adding the code that you, @neotrope, have described above. I’m hoping that someone will be able to figure out a more seamless integration. I have a plugin for Facebook comments that I’ve never used because Disqus has been just so ridiculously easy to use.
@DaneOLeary
the above coding is relatively easy to implement in theory, just not sure WHERE best to hook that stuff, since the Javascript has that pesky <div> in front of it; and don’t want the code loading on ALL pages or home page, or archives, only on POSTS.
The plugin that is in the WordPress repository has some issues, and I haven’t seen any major sites using that. For example IMDB is using the direct code from FB, and “works” if placed in the right spots.
We were using the lazy load Disqus alternative plugin, but again — Disqus has started to have issues as of Jan 1, so time to consider something different.
FB has become a juggernaut, without a doubt and can no longer be derided as waste of time quite so much as before. For some folks it’s become their only website for their company, the groups have almost killed a number of forums and yahoo groups, and it’s undeniably the #2 daily destination on the web outside of Google.
So, as much as I’ve hated the idea, it seems time to bow down and at least try it out for a bit and see what happens.
Just some feebdack on a Sunday morning 🙂
Hey Chris,
I’m on the facebook devs site right now trying to set something up, not sure why they had to make everything so complicated lol
But, yeah, I’d be very interested in this if it can be worked out so I’ll have a play around with it when I get a moment.
Hi, Andrei
thanks. 🙂
This is actually something you could likely “hook in” to the theme with a couple of boxes, without much trouble.
And for older installs, simply find the ‘best place’ to dump the two blocks of code in the various post/loop files, even if done manually.
I’ve been sidetracked by trying to deal with another thing entirely, so have not had free brain cells to play with this at length anymore at this time, but will get back to it later.
-
This reply was modified 10 years by
simchris.
Hi
Thanks for the feedback
Unfortunately we didn’t had time to investigate this yet and I can’t say yet which would be the best solution. However we will take a look in shortest time possible and when will find good implementation will make an announcement.
Thanks!
Hi guys,
Did anyone get time to investigate this? I’d love to implement it on a couple of sites but don’t really know what I’m doing here.
Please let me know if you come up with a solution, facebook comments have obvious benefits for sites and users, would be a fantastic if you could provide me a solution or if you could work it into the theme that would be amazing.
Best wishes
D
Hi
Sorry for late reply!
We manged to take a look to a possible implementation for Facebook comments on posts but we haven’t found a way to synchronize the number of comments from Facebook on the post. We also test this on a default theme and got the same behavior. The comments posted to a post shared on Facebook aren’t displayed on the site.
The plugin works fine with the theme by adding the js from Facebook after the body tag in header.php: http://screencast.com/t/97g6RJdc02cp then it’s required this line in the file corresponding with the post template used: http://screencast.com/t/TpOJKoUG8g – http://screencast.com/t/mahp4jf2
<div class="fb-comments" data-href="<?php echo get_permalink($td_mod_single->post->ID); ?>" data-width="100%" data-numposts="5"></div>
I’ve added this on our list and the time comes our developers will try to improve it. This may take some time because we have a long implementation list and we take them one by one.
Thank you all for your feedbacks.
-
This reply was modified 10 years by
Andrei L..
Seems pretty simple, actually. I will give it a go this week.
Thanks for the help Andrei L.! Your code in the header.php file worked. Only one issue–the comment count is appearing twice on our site (www.alaskapublic.org), once in the body of the post and once below. I’d like to delete the upper one. Our comment count is disabled in the theme panel.
Screenshot: http://www.alaskapublic.org/wp-content/uploads/2016/04/Screen-Shot-2016-04-12-at-4.12.41-PM.png
Hi
Try this css in theme panel > custom code > custom css to hide the first comment counter: http://screencast.com/t/ZyTOiRdT
.fb_comments_count{
display: none;
}
Thanks!
Hi Andrei L.
Thanks for your method, I was trying your method, but unfortunately, it’s not working in my way.
http://i.prntscr.com/d5ab40abadf64233b896e303281fbf1f.png
http://prntscr.com/bk109t
Waiting for your reply.
Thak you!
Hi
You will have to add this code: http://prntscr.com/bk109t in each files corresponding with post template used for your posts. Also make sure that you added the correct js in header.php file.
Thanks!
Hi
First you have to edit header.php file and paste the js from facebook as I’ve indicated here: Then edit loop-single-5.php and loop-single-9.php and paste this code where you want to display fb-comments. Here are some examples: http://screencast.com/t/KMfJ8O0jL2 – http://screencast.com/t/kWdtLeWQU8K – http://screencast.com/t/O5H1oEES6
<div class="fb-comments" data-href="<?php echo get_permalink($td_mod_single->post->ID); ?>" data-width="100%" data-numposts="5"></div>
Hope this helps.
Thanks!
Hi,
Thank you so much. finally, it’s working now. but still have a little problem, the comment box showing the bottom of the ads.
but I want the comment box here : http://prntscr.com/bkf78p
Thank you!
Hi guys,
Anyone here knows how to add this Facebook Page showing on top of the Facebook comment box? Same on this screenshot:
Please share how to achieve that.
Regards
-
This reply was modified 10 years by
ilnegozio.
