Reputation: 824
Update: the button is back : Facebook Share button: is it officially dead?
I have a strange problem. The Facebook share button has stopped displaying. The code used is
<p style="margin-top:-50px; margin-left:300px; width:600px;">Join us on Facebook
<a name="fb_share" type="button" share_url="https://example.com/"></a>
<script src="https://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript">
</script>
</p>
The code has not been changed since I was assigned to handle the website. Any ideas why this is happening? The HTML is there. But no button appears.
Upvotes: 2
Views: 12998
Reputation: 61
Facebook no longer use that.
Instead Use the below code.
And paste this after opening <body>
tag
<div id="fb-root"></div>{literal}
<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&appId=YOUR APP ID HERE";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>{/literal}
Anywhere you want this to appear, add this code:
<fb:share-button type="box_count"></fb:share-button>
Make sure you change the App ID, You must create app first
Upvotes: 6