Compact facebook share button with count?

BrunoLM picture BrunoLM · Nov 12, 2010 · Viewed 9.7k times · Source

I am trying to add a simple compact fshare button on my website. The only code I found was this one:

<div style="float:left;padding:4px;">
<a expr:share_url='data:post.url' name='fb_share' rel='nofollow' type='button_count'/>  
<script type="text/javascript" src="http://static.ak.fbcdn.net/connect.php/js/FB.Share"/>
</div>

Which should render as

fshare

But it is not redering correct. It seems it is trying to create multiple buttons and "crashes" all the page. It corrupts the HTML, change the background of a entire div and so on...

fsharecrash

Why is that? Is this the correct code?

Answer

Piotr picture Piotr · Nov 12, 2010

Facebook is not recommending the use of the share button anymore, instead you should use the like button. Here is what they say on their website:

We don't recommend the Share button for new developers. If you aren't already using the Share button, we recommend you migrate to the Like button and Open Graph protocol instead of Share for sharing pages from your website. The Like button is simpler to user and is the recommended solution moving forward.

With the like button, you can add it using javascript OR iframe, so you can see which one works best for you. Read more about the like button here.