Facebook Like Button Plugin

Update: This development of this plugin has been discontinued

So Facebook announced this new like button that everyone can implement on the web. This plugin makes it easy to add this button to your wordpress blog. Here is how Facebook describes it:

The Like button enables users to make connections to your pages and share content back to their friends on Facebook with one click. Since the content is hosted by Facebook, the button can display personalized content whether or not the user has logged into your site. For logged-in Facebook users, the button is personalized to highlight friends who have also liked the page.

If you have questions, comments or feedback please leave a comment on this page.

More info about like button on facebook.

Shortcode syntax

Example
[fb_like_button_standard] – shows the button in standard layout.
[fb_like_button_count] – shows the button in button_count layout.

Example with optional parameters
[fb_like_button_count show_faces="1" action="like" font="arial" iframe_style="margin:10px;"]

Optional parameters:

  • width = numeric, width in pixels
  • height = numeric, height in pixels
  • action = (like / recommend), Verb to display
  • font = (arial / lucida grande / segoe ui / tahoma / trebuchet ms / verdana)
  • colorscheme = (light / dark)
  • iframe_style = custom css style for iframe/xfbml

Screenshots

Example output

Configuration

Frequently Asked Questions

How do I turn off the button on a single post?

Give the post a custom field with the key “facebook_like_button”, and the value “suppress”. You can do this for as many posts as you want. If you remove the custom field, the button will re-appear on that post.

Why doesn’t my like buttons have a comment form?

The comment form doesn’t work when you use the iframe version of the like button. To fix this you have to select XFBML as you output and add a Facebook App ID. Dont forget to set a correct “Connect URL” for your Facebook Application you tend to use.

Why doesn’t the comment form show when I use XFBML?

Make sure you have added a Facebook App ID. If you don’t have one you can create one here. Make sure the “Connect URL” in the Facebook Application Connect Settings has the same url as your wordpress site.

How can I manually position the plugin in my theme ?

You code use the following code.


//display standard button

<?php echo facebook_like_button_plugin_sc_standard($options); ?>

//dissplay button_count button

<?php echo facebook_like_button_plugin_sc_count($options); ?>

$options is an array with same options as the shortcode. If you want to use your defaults just pass an empty array as argument.

How can I add the button as a Widget in the sidebar?

Add the following code to your themes functions.php file:


add_filter('widget_text', 'do_shortcode');

This allows you to add shortcodes in Text Widgets.

Download

facebook-like-button-plugin

  • http://twitter.com/wantmag Want Magazine

    Great plug-in. Very useful… To improve it against all the other clones out there: How about a feature to suppress it a page-by-page basis?… I suggest to mimic the Topsy.com technique: Using a custom-field (i.e. “facebook_like”) and the value “suppress” on those pages/posts where is not needed)

  • http://www.martinj.net martinj

    Sounds like a great suggestion. Will take a look on that.

  • Pingback: Adding Facebook’s Like Button to a WordPress Blog – blogan

  • Jon

    is there any way to make the font that reads

    “be the first of your friends….” or after its been liked “likes this”
    appear as white as opposed to black…if so how…im sorry..im a newbie programmer

    its because the backdrop of my blog is black so the letters get lost

    thanks so much

    great pluging!

  • Jon

    Additionally, is it possible to receive e-mail notification when someone “likes” something of yours.

    thanks again

  • Pingback: Erica Says » Adding the Facebook Like Button to Your Wordpress Blog

  • Aleksandra

    Hello, I really like the button and I have already install it on the website – but – there is small problem that has appeared: the language of the website is English and the language of the like button is in Polish, my own language. Please, give me a clue how to change the language settings in the button.

  • http://www.martinj.net martinj

    It might be possible to do some extra styling by using classname that facebook supplies. This isn't anything that I would include in the plugin unless facebook add a specific option for it.

  • admin

    The language is set to whatever the visiting Facebook user has. E.g if the user has Polish language on his Facebook account then it will use Polish. As far as i know there is now way to force it to a specific language at this moment,

  • http://lukaszmacheta.com Lukasz

    Hi,

    Thanks for a plugin, I have a strange problem when I choose “button_count” style – two of my friends liked one of my posts but plugin still shows only “0” instead of “2” or “3”

  • http://www.bravocharlie.tv Bravo Charlie TV

    Excellent plugin, live all over http://bravocharlie.tv and I've got people sharing the activism stuff, the music stuff (check out Jame Forbes if you like acoustic guitar, I swear he is going to be a star soon) and the business stuff within minutes of it going in.

    Simple setup, excellent work. Thank you. – Phil, Melbourne

  • http://evelynparham.com/ Evelyn

    Thanks for sharing this! I found it to be very helpful!

  • http://www.martinj.net martinj

    Maybe the data you received from facebook was cached. Try clear cache or restart your browser.

  • http://lukaszmacheta.com Lukasz

    Unfortunately it doesn't work, please take a look: http://lukaszmacheta.com, my friends liked first two posts, but all I see is “0” ;/

    Thanks for your reply

  • http://www.martinj.net martinj

    Working on it.
    There are several reports of this problem from people using the like button not just my plugin. Trying to figure out if facebook is to blame or if I can do something to fix it.

  • http://www.martinj.net martinj

    It just crossed my mind that if you change the Color Scheme to dark the text will be visible on black background 🙂

  • http://bit.ly/gwalter gwalter

    How come you're not using your own plugin? 😉

  • http://www.martinj.net martinj

    I do, look right above “share some love and share” on this page.

  • http://lukaszmacheta.com Lukasz

    Sounds great! Take care

  • DJSD

    Thank You for Your Hard Work! It is Great!

  • http://bit.ly/gwalter gwalter

    Oops – sorry. my bad.

  • chrissiwake

    This is a great plugin enabling more links between social media accounts. Thanks for sharing, going to try and implement now.

  • jeroz

    Hi and thank you for our really great job !!
    I have one question : Can i put your plugin in a widget sidebar ?
    Thanks a lot !

  • http://www.nilssonlee.se/ Jonas Nilsson Lee

    Jättebra plugin! Jag undrar bara en sak. Jag har ett inlägg som tre personer har gillat. Men den visar två namn. De tredje namnet byts in lite på random. Borde det inte så sven nilsson and joakim svensson and 1 other likes this.

  • http://kyleweller.com Kyle

    On facebook I'm getting “Kyle likes Meg + Mark on content.” I need to the word “content” to be my website name. For some reason it's not pulling it. Any help on this?

  • http://www.martinj.net martinj

    Vågar inte svara på det, du får gräva efter info hos facebook om det.

  • http://www.martinj.net martinj

    The meta information that it use is the Post/Page title and Blog Title under General Settings.

  • http://www.martinj.net martinj

    Not at this time.

  • http://kyleweller.com Kye

    It appears the problem was the SEO plug-in “Headspace2” interfering. Your plug-in is now pulling properly but I had to deactivate the other. Thanks for the quick feedback!

  • http://www.nilssonlee.se/ Jonas Nilsson Lee

    Aight! Thanks 🙂

  • Pingback: Facebook Like Button Updated | Martin Jonsson

  • http://www.amazee.com Lucas Bally

    Hi!

    Thanks for this great plugin!
    Just one little note: As I saw there is no setting to show/hide the button on the search results pages. Maybe you can add this option to a later version (I'm using Version 1.2).

    Cheers,

    Lucas

  • http://myiphone.sk libor

    hi
    I just want to ask you guy if you're having any difficulties with Fx. Fx just won't publish that “Like” to facebook page.
    Fx – remember my link but not sharing
    Opera – wont even remember but also share
    Safari – OK, Chrome – OK

    I also put that facebook script http://developers.facebook.com/docs/reference/j… to my index

    or am I doing something wrong?

  • http://Topeka365.com John

    I have installed the plugin on my new blog and the like button on my first post added my pic and said 2 other people liked it, but only my pic was showing up, why not the others?

  • http://www.martinj.net martinj

    Facebook only shows profile pictures of your friends.

  • http://twitter.com/Whig Petri Lopia

    Maybe it is just me but for some reason this doesn't seem to work right on my blog.

    Example this page: http://www.petrilopia.net/wordpress/security-an… I clicked that recomend/like link and everything seemed to work ok but on that page there still is that “Be the first…” link.

  • http://www.fastmotoring.com/index.php/2010/05/audi-r8-v10-in-malaysias-pavillion-kl/ Ben

    Hi,

    i got error when “like” my site…somehow only few of the blog post is ok….

    i use your plugin and also the coding from facebook itself..i troubleshoot for 2 days …still no luck…can you help ?

    please refer my site at

    http://www.fastmotoring.com/index.php/2010/05/a

  • http://www.martinj.net martinj

    The FB admin property you supplied is invalid (kokben) it should be your FB profile id.

  • http://www.martinj.net martinj

    Seems to work just fine for me. Though i know several people has reported that the facebook doesn't always report everyone that has liked it, hopefully they will get that fixed soon.

  • http://www.fastmotoring.com/index.php/2010/05/audi-r8-v10-in-malaysias-pavillion-kl/ Ben

    hi i tried my profile id, also the id number…cant

    my profile is http://www.facebook.com/kokben
    is correct isn't it ?

  • http://twitter.com/Whig Petri Lopia

    For me it still says “Be the first of your friends to recommend this.” even that I have liked that once. I have seen my name once there instead of that “Be the first…” text but now I can't see it even that I checked that page with IE and firefox.
    Or do I have to be logged in to facebook before it says more than just “Be the first…”?

  • http://www.fastmotoring.com/index.php/2010/05/audi-r8-v10-in-malaysias-pavillion-kl/ Ben

    hi,

    for some reason..it's working now…many thanks for the plugin..great work..
    however…

    i have 2 post in wordpress which created a fb page…

    http://www.facebook.com/pages/Fastmotoring-Volk

    so besides the like button, as i am the admin, i able to see a link with “adminpage”

    any idea on this?

    can do u have a solution to assign the 1st image of the post when u share to fb?

  • http://www.martinj.net martinj

    The image you assign as a thumbnail to a post will be used.

  • http://www.martinj.net martinj

    Facebook hasn't released any details for how this works. But it seems like you wont see any likes until there is a few when not logged in to facebook. And when logged in you will probably see the likes that are from friends in priority to the likes from everyone.

  • http://twitter.com/Whig Petri Lopia

    OK. I just feel weird to have “Be first” even when somebody has liked/recomended that for all of those who hasn't logged in to FB.
    But I just tested and it seems to be like that what you just said… when I opened new tab and loggind in FB “Be first” disappeared and my name was there and when I logged out from FB it went back to “Be first”.

  • johnconner24

    The like button works but I dont see the admin link. I have the correct user ID set but I dont see the admin link. You can check the source code here http://brijux.com

    Also, for one of the post on my blog had 900+ likes after I just installed the like button? How did people liked it even before my page had like button?

  • Nix

    Try a site like this (although this one is in hungarian):

    http://tetszik.org/?s=martinj.net

    Use the upper search form with your domain for searching.

  • http://klparking.com CincauHangus

    Is it possible to retrieve the number of likes into a custom field in a post?

  • http://www.careermoxie.com Allison

    This is the 4th plugin I tried and it worked beautifully. Thank you! Only trouble is it does not seem to be working in Internet Explorer. Looks great in Firefox, but now showing in IE. Not an issue for me, but for my site visitors using IE. Two different sites – check the “articles” page on both to see what I'm talking about: http://www.careermoxie.com and http://www.instanthrsolutions.com

  • http://www.moxdom.com Matthew Kettlewell

    I've got your plugin working (big thanks too)… but there is interference with the sidebar code from FB to display my FB page updates…. is there something special I need to get FB code and your plugin to play nicely?