• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

How to setup facebook comments on Chevereto 3.x

Status
Not open for further replies.

lorigana

Chevereto Member
Dear,
I try to use that code in Dashboard/Setting/external services to insert facebook comment plugin on my site, but it not work, how to get current URL of site to using facebook comment plugin ?

PHP:
<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/vi_VN/all.js#xfbml=1&appId= my app id";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<fb:comments href="<?php echo get_image()["url_viewer"]; ?>" numposts="5" colorscheme="light"></fb:comments>
 
Facebook comment plugin doesn't understand that when the hfref param is empty it should use the current URL (like Disqus). Anyway, use this code:

Replace this:
Code:
<fb:comments href="<?php echo get_image()["url_viewer"]; ?>" numposts="5" colorscheme="light"></fb:comments>

With this:
Code:
<script>document.write("<fb:comments data-href='" + window.location.href.split('/?')[0] + "' num-posts='5' colorscheme='light'></fb:comments>");</script>
 
Last edited:
@Rodolfo # Version 3.1.2 Suggestion... Maybe on the next update you can do a drop down feature for the "comment code" setting that automatically has the correct facebook code and disqus code in the system, along with an option for custom code those people who want to use their own code for comments. This option should allow a user to add which facebook id they want the comments admin to be and disqus should have an option to put your disqus shortname in.

I.E.
Comments
< Select Comments Service> Drop Down
FaceBook
Disqus
Custom Code
 
Sure, but my recommendation is use Disqus. Facebook comments are not so great.

Cheers.
 
Status
Not open for further replies.
Back
Top