Question: Facebook comments plugin - How to login

Question

Facebook comments plugin - How to login

Answers 1
Added at 2017-11-30 17:11
Tags
Question

I am adding the facebook comments plugin to my website and have little coding knowledge.

I have added the following after the opening body tag:

<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 = 'https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.11';
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

And the following where I want the comments to display:

<div class="fb-comments" data-href="https://www.bbuboxing.co.uk/featherweight.html" width="100%" data-width="100%" data-numposts="5">

If I or a visitor is not logged in to Facebook, the plugin displays a button saying log in to post but I can't click it to log in, the button isn't clickable.

How do I make it so that I(or a visitor) can click this button to log in?

Answers to

Facebook comments plugin - How to login

nr: #1 dodano: 2017-11-30 17:11

you're missing your app id which needs to be appended to the end of the src property in the sdk script tag like this:

<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 = 'https://connect.facebook.net/en_GB/sdk.js#xfbml=1&version=v2.11&appId=XXXX';
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

replacing the XXXX with your registered facebook app id. if you haven't registered an app yet visit https://developers.facebook.com/ and go through the registration and signup process.

Source Show
◀ Wstecz