Compact Facebook share button with counting?

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

 <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 be displayed as

fshare

But this is not true. It seems that he is trying to create several buttons and "displays" the entire page. It corrupts HTML, changes the background of an entire div, and so on ...

fsharecrash

Why? Is this the correct code?

+4
source share
3 answers

Facebook no longer recommends using the sharing button, instead you should use the type button. Here's what they say on their website :

We do not recommend the Share button for new developers. If you are not already using the "Share" button, we recommend that you go to the Like page and the Open Graph protocol instead of Share to exchange pages from your Website. The Like button is simpler than the user and is the recommended solution when moving forward.

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

+5
source

http://sharethis.com provides a widget that allows you to enable buttons for various sites on social networks, including the fb sharing button with an account. (This has its own style and size, so you may need to redefine some of the CSS to make it look like a standard FB share.) There is also a solution at http://blog.pixert.com/facebook-share-button/ , but I could not get him to display the score.

+2
source

Change your code

  <a expr:share_url='data:post.url' name='fb_share' rel='nofollow' type='button_count'/> 

to

 <a expr:share_url='data:post.url' name='fb_share' rel='nofollow' type='button_count'>Share</a> 
0
source

All Articles