I want to add a like button to my website but I'm having trouble doing so.
After some research I found this code that has to be right after the opening body tag:
<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_GB/sdk.js#xfbml=1&version=v2.9";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
and with it comes this code that goes where I want my like button in the page:
<div class="fb-like"
data-href="http://www.facebook.com/curlybracketssarl"
data-width="200" data-layout="standard" data-action="like"
data-size="small" data-show-faces="true" data-share="false"></div>
Yet nothing is showing, I even tried to do so in a blank page and got no results once again.
So can you kindly tell me how to do what I need to do?
Related
Every time I put a dynamic url in my facebook social plugin, the like buttons won't show or load.
This is what I did.
<div class="fb-like" data-href="{{$business->fb}}" data-layout="standard" data-action="like" data-size="small" data-show-faces="true" data-share="true"></div>
I already load the 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/all.js#xfbml=1&version=v2.9&appId=xxxxxxxxx";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
But the like and share buttons won't show and there are no errors in the console.
Please take a look at this page. https://developers.facebook.com/bugs/1914581255449300/?hc_location=ufi
Seems like there's a global issue with the like and share button. Keep an eye on this page to see if it's fixed or not.
Regards,
Andrew
i'm terribly stacked into this silly situation where i cannot make the standard Facebook Like Button plugin to work.
I'm using the default code that Facebook suggests with no luck:
<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&appId=189637597750754&version=v2.3";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
and have the classic elements as well:
<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
Here is a demo
I really cannot figure out what is wrong with it.
Here is code for like box we need to add comment box and like box in each post...
<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/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like-box" data-href="http://www.facebook.com/OneLife4Live" data-width="600" data-height="400" data-colorscheme="light" data-show-faces="false" data-header="flase" data-stream="true" data-show-border="true">
</div>
you keep logged in facebook on another tab.
you will get Likebox and commentbox directly when you facebook logged in browser.
as the title says, I found out my like box not appearing unless I am logged in facebook
Back in the past it was not like this
On some websites, I see the like box showing up even if I am not logged; I checked the code, and what differs from mine is that they have an AppID
Could someone please explain this to me?
if you are using an AppID your Check your application not running in sandbox or development mode
here is a sample of your like button code
<div class="fb-like" data-href="https://developers.facebook.com/docs/plugins/" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
<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_GB/sdk.js#xfbml=1&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
I am trying to make a plugin in my website just like this one :
I am using this code. It includes the script :
<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_GB/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
and this :
<div class="fb-like" data-href="htpp://www.my-site.com/" data-width="600" data-height="30" data-colorscheme="light" data-layout="standard" data-action="like" data-show-faces="true" data-send="true"></div>
but nothing shows up. Do I have to use css or a js link included in my page to make it work?
I think you are missing the appId. Make sure to create a Facebook application and connect it with your plugin.