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://thebudgetsocialite.com/ Trinidad

    This works great.
    The only problem is i can't seem to get the “like” to show up on my recent activity on fb.
    It shows that i like the item on the blog and shows my name and pic – but not on fb. Can anyone help? It shows up on recent activity when Iike other articles on other blogs. Here's my url if that helps

    http://thebudgetsocialite.com/

    thanks!

  • http://www.martinj.net martinj

    Tried it on your site and it worked for me.

  • http://www.chris-moody.com Chris Moody

    I've added the Facebook Like widget to my WordPress blog, but it isn't linking me as the Admin on Facebook. Any suggestions?

    chris-moody.com/blog is the site.

    I have chrismoody (username) and the ID that I was given listed as admins.

  • http://www.moochyschwag.com moochyschwag

    This is sort of important to me.
    When I used the plugin it works okay but: it says
    MOOCHYSCHWAG LIKES <URL>
    instead of <POST TITLE>
    Can it be configured to post the post title?
    Are corresponding pages being created? I don't see that either.

  • http://twitter.com/sandlog sandlog

    i got it to work by using iframe instead of XBML (even though i created an app id it wouldn't show).

    but i now have the issue of it showing a URL instead of the POST title for the item i like.

    where to change that?

    i tried your site and it didn't show on my recent activity when i chose that i liked it.

  • Martin

    Hey,

    I love the plugin it is great!

    I just had 2 quick questions.

    1) Does it matter where abouts in functions.php you put: add_filter('widget_text', 'do_shortcode'); ????

    2) Could you please give an example of an embed code with short code in it.

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

    What can I put in the $options area? what would the shortcode look like inside that container?

    Thank you!

  • http://twitter.com/MF_III Manolis Avagiannis

    Hi,

    Anyone manage to make this work from the News Feed? I mean the problem that when a frined likes something it is not shown on your News Feed but only in his Activity :(

    I have put the meta properties (title, type, site_name), the iframe version but i cant manage to get it work :( :( Sometimes it appears for a little in the News Feed and suddenly disappear :/ I can't understand..

    Anyone has a sure working solution?

  • Pingback: How to insert social share buttons [facebook, twitter, buzz, digg] – rushlay

  • Dshakfeh

    Hi, I am having a problem I hope you can help me?

    I added the plugin and code as directed but along with my “like” button it says this:
    Warning: Missing argument 1 for facebook_like_button_plugin_sc_count(), called in /home/findusg1/public_html/shakfehlaw.com/wp-content/themes/blurex/index.php on line 36 and defined in /home/findusg1/public_html/shakfehlaw.com/wp-content/plugins/facebook-like-button-plugin/facebook-like-button-plugin.php on line 19

    Can you please help?

    My blog is http://www.ShakfehLaw.com and I am using wordpress.

  • Pingback: The Best WordPress Social Media Plug-ins | Devlounge

  • Pingback: The Best WordPress Social Media Plug-ins | CSS Citadel

  • Maria

    check this one out. THeyve done it all. http://ilike.mikaviva.tk/
    it runs mainly on facebook like button :D

  • Green

    Whenever I try to update settings, I get this error.

    Warning: unserialize() expects parameter 1 to be string, array given in /home/username/public_html/wordpress/wp-content/plugins/facebook-like-button-plugin/facebook-like-button-plugin.php on line 205

    Please make a note of it.

  • http://www.martinj.net martinj

    If you are using wordpress 3.x, this might be your problem. The plugin hasn't been tested with wordpress 3.x yet.

  • Pawel

    Hi,

    I use it here: http://www.fotomargines.pl/2010/08/18/biblia-fo… and it os OK
    I try to use at http://www.pawelsuder.pl/hala-ocynowni-arcelorm… and try to put manually <?php echo facebook_like_button_plugin_sc_standard($options); ?> before category but nothing happens :( Any idea? :)

  • http://www.autumncutaia.com Autty

    How do I get it to not try to download something to my computer everytime I go on the main page after it's on there?

  • http://twitter.com/mpspencer Michael

    Could you please add a Google Analytic event tracking option to your WP Facebook Like Button plugin? Details of how to implement are over at http://www.websharedesign.com/blog/how-do-i-tra

  • Pawel

    @martinj, can you help??

  • http://www.facebook.com/profile.php?id=840750397 Zafer Durmuş

    I used this plugin on http://www.unili.com it works well the only problem is it shows likes only the persons recent activity, not the home recent actions.

  • Claudia

    Hey,

    great Plugin but i’ve got one tiny problem: My page background is pretty dark, which means that the “..and…have like this” text is pretty hard to read. Is there any way to work around this, like changing the color via the css options or putting a lighter colored div underneath it? i’d be glad if you’d help me with this…

  • Max

    Thanks a lot! I used it for http://www.xboxslim.nl

  • http://predicate-llc.com jeffmacintyre

    Can you specify a URL with the shortcode syntax? The button on my home page (since removed) is throwing errors, associating with the wrong post page (and not the home page instead).

    I've tried using the main Facebook Like code but then that presents a conflict with the plugin, it seems. Perhaps I just have to remove the plugin entirely? Help! And thanks, this is a great assist to me.

  • http://www.facebook.com/people/George-Paulussen/100001723367363 George Paulussen

    It works great but it shows a picture on facebook that is on my sidebar any way i can change that somewhere?

  • Catalin

    It doesn’t validate…although problem was solved here : http://scriptgenerator.net/77/Valid-W3C-facebook-like-button/

  • Starvingjack

    Hi Martin,

    First of all, great job on the plugin.
    I inserted it manually into my home page and have trouble positioning it to the place i want. I wish to position it higher and to the right. Please help me! This is the script i used.

  • Starvingjack

    Hi Martin,

    First of all, great job on the plugin.
    I inserted it manually into my home page and have trouble positioning it to the place i want. I wish to position it higher and to the right. Please help me! This is the script i used.

  • Pingback: The Best Wordpress Plugins for Your Wordpress Blog

  • http://www.webdesignmauritius.info Web Design Mauritius

    Thanks for the tutorial. It was of great help.

  • Anonymous

    Hi, we encounter a problem using your plugin cause by the function “add_facebook_like_button_plugin_submenu”. The slug name define by the constant __FILE__ return absolute path by PHP when using symbolic link into unix. To resolve the problem, you need to use plugin_basename(__FILE__) instead of __FILE__. Example : add_submenu_page(‘options-general.php’, ‘Facebook Like Button’, ‘Facebook Like Button’, 10, plugin_basename(__FILE__), ‘facebook_like_button_plugin_options’); instead add_submenu_page(‘options-general.php’, ‘Facebook Like Button’, ‘Facebook Like Button’, 10, __FILE__, ‘facebook_like_button_plugin_options’); at line 499

  • Ben

    once the button is clicked does it just take a long time for it to show up in a news feed? i clicked it and it is still not showing up in mine.

  • Bethann

    How do you change the setting on your FB plug-in that you already have on your FB page? I must have clicked “don’t show faces” of people who like and want to change that. I can’t find the place to do it. I’ve spent about an hour + looking for it.

  • Dario

    Ciao,
    sorry for my bad english!
    I can see the button “I like” and it work correctly.
    Why in the back end of WordPress I have that error:

    Warning: unserialize() expects parameter 1 to be string, array given in /home/fifthave/public_html/wp-content/plugins/facebook-like-button-plugin/facebook-like-button-plugin.php on line 205

    ? what must I do?

  • Aurelien

    I’ve got a problem, when I click on the like button, nothings appends, I’ve got this response:
    “requires_login”:false,”success”:false,”already_connected”:false,”is_admin”:false,”show_error”:false,”error_info”:null

  • Ian

    I am using the plugin and it works great but I have an issue. I have several face book pages 1) called chester events 2) called http://www.chesterevents.com

    When the liked button is clicked I get an email to say it has been liked but I want the “likes to like my http://www.chesterevents.com page but it does not it likes my chester events page.

    How do I change this, I have looked at the code and can’t seem to see anything I should change

    My website is http://www.chesterevents.com as is my fb page.
    Many thanks

  • Noirman555

    I’ve lost my share option button off facebook..can somebody help me ?

  • http://catladydesignsonline.com Cat

     I know this is late – but for anyone needing the solution…in wp-content/plugins/facebook-like-button-plugin/facebook-like-button-plugin.php on line 205 change $options=unserialize to $options=maybe_unserialize – I stopped getting the error message and everything seems to be working correctly still! :)

  • 154443

    Nike Lebron shoes andNike ZOOM LeBron  new burberry replica burberry lebron 8 v2i want to look some pandora jewellery; pandora  jewellery beads cheap  nfl jerseys or jersey supply and religion jeans, you can leave a email  to me! thank you! nike air max 2011white air maxnike griffey maxreligions jeanstrue religions jeans true religion jeans outletbears jersey blackhawks jerseyken griffey shoes air griffey maxken griffey jr shoes
    air griffey max 2cheap Pandora Necklacescheap Pandora Ringscheap Pandora Setscheap Pondora Packagesherve leger bandage dressesmoncler down jacketmoncler doudounesmoncler coatcheap moncler jacket
    detroit lions jersey</a
    cheap authentic jerseys
    cheap nfl jerseys
    youth nfl jerseys
    nfl jerseys wholesale
    religion jeans outlet
    true religion store
    true religions
    true religion billy
    true religion men
    men Bootcut jeans
    men Flare jeans
    men Skinny jeans
    straight leg jean
    true religion women
    women bootcut jeans
    women Flare jeans
    cut off jeans shorts
    girls skinny jeans
    straight legs jeans
    nike shox shoes
    sb dunks
    true religion joey
    true religions jeans
    true religion men jeans
    cheap religion jeans
    cheap true religion men jeans
    true religion boys jeans
    true religion billy mens
    true religion cargo pants
    true religion corduroy jeans
    true religion capris
    true religion joey jeans
    cheap religion jeans
    true religion mens skinny
    True Religion Straight Leg
    true religion womens jeans
    true religion denim jeans
    true religion denim shorts
    true religion straight leg jeans
    True Religion Wide Leg
    skinny bootcut jeans
    True Religion lizzy
    True Religion joey rainbow
    True Religion casey legging
    True Religion lone star
    True Religion stella

    True Religion shirts for women

    true religion uk

    moncler uk

    moncler down jackets
    moncler hommes

    blackhawks jersey
    bears jersey

  • 154443

    Nike Lebron shoes andNike ZOOM LeBron  new burberry replica burberry lebron 8 v2i want to look some pandora jewellery; pandora  jewellery beads cheap  nfl jerseys or jersey supply and religion jeans, you can leave a email  to me! thank you! nike air max 2011white air maxnike griffey maxreligions jeanstrue religions jeans true religion jeans outletbears jersey blackhawks jerseyken griffey shoes air griffey maxken griffey jr shoes
    air griffey max 2cheap Pandora Necklacescheap Pandora Ringscheap Pandora Setscheap Pondora Packagesherve leger bandage dressesmoncler down jacketmoncler doudounesmoncler coatcheap moncler jacket
    detroit lions jersey</a
    cheap authentic jerseys
    cheap nfl jerseys
    youth nfl jerseys
    nfl jerseys wholesale
    religion jeans outlet
    true religion store
    true religions
    true religion billy
    true religion men
    men Bootcut jeans
    men Flare jeans
    men Skinny jeans
    straight leg jean
    true religion women
    women bootcut jeans
    women Flare jeans
    cut off jeans shorts
    girls skinny jeans
    straight legs jeans
    nike shox shoes
    sb dunks
    true religion joey
    true religions jeans
    true religion men jeans
    cheap religion jeans
    cheap true religion men jeans
    true religion boys jeans
    true religion billy mens
    true religion cargo pants
    true religion corduroy jeans
    true religion capris
    true religion joey jeans
    cheap religion jeans
    true religion mens skinny
    True Religion Straight Leg
    true religion womens jeans
    true religion denim jeans
    true religion denim shorts
    true religion straight leg jeans
    True Religion Wide Leg
    skinny bootcut jeans
    True Religion lizzy
    True Religion joey rainbow
    True Religion casey legging
    True Religion lone star
    True Religion stella

    True Religion shirts for women

    true religion uk

    moncler uk

    moncler down jackets
    moncler hommes

    blackhawks jersey
    bears jersey

  • Kwillrichardson

    For some reason I gets the message/hack “hacked by SuN-HaCkEr” with one of my fb like buttons…doesn’t matter whether the button is automatic or shortcode…only happens on one button/page…any ideas what could cause this…Willy

  • Andrew Kentigern-Fox

    Great plugin, nice.    I am using an antisnews theme,  and have had problems with the wrong image being selected.  i added   ‘full’  to the line 152  and now it returns the correct thumbnail,  it was picking up ramdom images from my footer otherwise for some strange reason.

    $thumb_meta = wp_get_attachment_image_src($thumb_id,’full’);

    My site using this plugin is : http://rtw.gs

  • Anonymous

    I have a working plugin for this however, my widget likes the page opposed to the fan page.. Is this a common problem? Can’t seem to find a solution except using Iframe for the sidebar and a plugin for all the rest

  • Gouni14

    why is there a logo [red M] in the post on the facebook wall ?

  • Gouni14

    Hi, I am not sure what to put as Admin ID?  Just my facebook user name?  Also do you know why I am getting this error ?  The message says the App_id specified in the meta fb:app_id is not autorized for this domain?  Sorry I’m a newbie

  • http://fandbfood.com/ Sumon Ahmed

    Very Helpful and Awesome Plugins, I am using the Plugin in My Blog.
    Thanks for the Nice Plugins.

  • Asaf

    Hi,

    I’m using facebook comments plugin, and I get an error: The parameter href is required on the output page.

    As I understand from facebook’s developers roadmap, there should be an absolute URL in the href parameter.
    Where can I set it in your plugin?

    Regards

  • Asaf

    Sorry, I meant facebook like button plugin