Aside

“SNV Facebook Like Button” Plugin

Plugins 110 Comments »

Well, I’ve gone and done it – I wrote my first WordPress plugin.  I’m super stoaked on how easy it was, and I may end up doing some more work in the future.

And, for my first number, I tackled the same problem I did in my last post: the new Facebook “like” button.

The way I had inserted was too complicated, and required editing of the core plugin.

Not anymore.

Introducing the “Facebook Like Button” plugin.

Basically, it does one thing, and one thing well: It lets you insert the new Facebook like button either under the content of your blog post, above your comments and other social plugins (bookmarks, etc) or insert it manually via a function/template tag.

Simply activate the plugin and head over to the options menu to control the various options (color scheme, width, height, etc) of the plugin, then sit back and watch as your friends “like” your content.

When a person likes a post, by the way, it ends up in their Recent Activity Stream.

Download Version 1.6 of the Facebook Like Plugin

And, as always, feedback is much, much appreciated :)

Version 1.6 adds a whole host of options, from height, width, margin, the verbiage, and more.  It makes the process so much easier than just filling in option menus.  Please enjoy!

Changelog:

0.1a – initial release.
0.2a – fixed spacing issue both above and below
1.0: first stable release – added function to add to a template manually (thanks Amber Weinberg!)
1.5 – added the rest of the options FB gives you (minus the button type – I like the faces, and that’s specifically what I designed this plugin to do).
1.6 – for some reason 1.5 couldn’t be downloaded so 1.6 is just a clone to resync the plugin repository.

Post comment as twitter logo facebook logo
Sort: Newest | Oldest

Hey Mitch, is it possible to update this plugin so that if a featured image is included in a post, it uses that as the image? I believe the fb tag is og:image

I found this page from the 'visitindiana' blog, while looking for a Facebook like plugin. Thanks man, good job - you were highly recommended and I'm giving this a shot.

Hi Mitch! I absolutely love this plug-in, have used it for months, and now somehow it's showing up on Pages again. I'm sure it's something I did, but would you please tell me now to omit Pages from the "likes?" Thanks!!

It will only show people who are friends of yours. If 13 people likeit, and 2 of them are friends, it will only show two faces. That'sfacebook's security at work :)mitch

I already read that you're fixing the big space that happens below the button, and I would click "like" on that if I could. :) Now my question is: on the blog where I'm using this, one of the posts says "13 people like this" but it only shows one picture (specifically, mine). Shouldn't all the pictures be showing? Or will it only show pictures of people who are logged in? If so, do I have a choice to show the pictures even when they're not? I think the smiling faces of lots of people who like the post would be better advertising for its popularity than just a number (but if I can't control it, I s'pose that's okay too.)

Thanks for your (albeit non-constructive) comment. I had mentionedabove that this was my first plugin, and I'm very open to anysuggestions on how to fix it and make it better seeing as how I knowit's a little rough around the edges. If you'd like to make anysuggestions, please do so (that goes for anyone else).

The code of this plugin sucks. I've just posted a comment on Think Vitamin but I thought it'd be more appropriate here.First lines of the plugin://plugin defaultsadd_option ( ‘width’, ‘450′ );add_option ( ‘height’, ‘70′ );add_option ( ‘font’, ‘arial’ );add_option ( ‘verb’, ‘like’ );add_option ( ‘padding-vert’, ‘0′ );add_option ( ‘padding-horz’, ‘0′ );add_option ( ‘color-scheme’, ‘light’ );FAIL.Not only you should add all the options in *one array* instead of 7 individual records, but what is the point in issuing 7 extra SQL requests on every page request to re-save those values???

Try updating the settings - sometimes it takes that to kick-start theplugin. I'm still working on a fix for it.

I installed the plug-in but I don't see a Like button anywhere on my site. Is this supposed to be a widget? Short-code? How do you make the button appear?

I installed the plug-in but I don't see a Like button anywhere on my site. Is this supposed to be a widget? Short-code? How do you make the button appear?

Try updating the settings - sometimes it takes that to kick-start the
plugin. I'm still working on a fix for it.

IT should show up on all posts instantaneously. If it doesn't show upright away, try saving your settings to see if that "triggers" theplugin.

Thanks for doing this. Is there any way I can have this show up on all my previous posts?

Thanks for doing this. Is there any way I can have this show up on all my previous posts?

IT should show up on all posts instantaneously. If it doesn't show up
right away, try saving your settings to see if that "triggers" the
plugin.

How do you get the icon to be at the side of each post instead of below?? How do I remove the icon from the bottom of each page on my Wordpress blog???ThanksSB

Very cool. Thanks. Simple install!Does deselecting actually remove the "like?" Seems that one needs to be logged in to FB for it to "like?"

Mitch, activated your plugin, but it doesn't work for me. am i supposed to manually edit html? i don't see any other options when i click 'edit'...

Sorry for the delay in replying to this - been at a conference. You should have it automatically added to your theme, but if not you can add it manually using the theme editor and the shortcode provided in the theme options.

Good call - I think that's an addition I need to make.Mitch

Thanks for the plugin Mitch! I appreciate the control panel you created. You might want to give users the option to turn the images off as well. "show-faces=true/false"Thanks again!

Thanks for the plugin Mitch! I appreciate the control panel you created. You might want to give users the option to turn the images off as well. "show-faces=true/false"

Thanks again!

You have to edit the code - there's a template tag we created in the optionsmenu that will let you drop it in wherever you want.

this is really a nice plugin. Very easy and looks good.You say you can move it? I've installed it (http://shotgunconcepts.com) and I'd like to move it below my sociable buttons for a tighter look. I've looked in the options/setting for a place to move -- or do you have to go in and edit the code?

You can insert the button directly with facebook's code - there's a site on facebook's network that lets you do all of the customization items I put in but through their site - it generates the iframe code for you.

I am wondering if your facebook like button works in regular websites not just blogs. A non-profit I work with is trying to encourage more on-line participation by putting at least one "like" button on our website. Instructions don't work for us. Not sure how easy it will be to get a fix from Facebook. Thanks! Meg

I am wondering if your facebook like button works in regular websites not just blogs. A non-profit I work with is trying to encourage more on-line participation by putting at least one "like" button on our website. Instructions don't work for us. Not sure how easy it will be to get a fix from Facebook. Thanks! Meg

I am wondering if your facebook like button works in regular websites not just blogs. A non-profit I work with is trying to encourage more on-line participation by putting at least one "like" button on our website. Instructions don't work for us. Not sure how easy it will be to get a fix from Facebook. Thanks! Meg

Actually, there is a way to make it show up only on posts - if you edit yoursingle.php (and index.php) you can drop in the code that will allow you tomanually insert the like button (it's a function/template tag). Change theAutomatic setting in your options menu to Manual and pull the code belowit... copy that code wherever you want it displayed, and it should drop itright in.

It does, actually, but that's a great idea for a feature (hide on pages).Thanks for the comment - i'll see what I can do!Mitch

hi! I'm actually using another Facebook "Like" plugin from AJ blog and I'm quite satisfied with it but the problem with his plugin is that the Like also appears in the pages like "Contact" which I don't like. How about this plugin? Will it just appear on my posts?

Mitch -

I was literally looking for something like this two days ago...I am trying it out at Themarryblogger.com! Thanks!! (I put the regular 'like' button in my sidebar, and then added your plugin) I might take the like off of the sidebar totally.

I've got the plugin finished, I've even added an option in the admin menu to insert it manually or automatically. Where do you want me to send it to?

Nice job! Easy install, seems to be working great!

Sweet - I'll add you in as a contributed when I update the SVN nexttime :-)Mitch

Ah ok that really freaked me out LOL> I was actually in the middle of editing your plugin so you could manually insert it where you wanted to but I lost it when I upgraded (wasn't paying attention LOL) I'll shoot you the code if you want it if I redo it :)

Sure, i'll put that in the notes for a future release - the option of beforethe content or after the content (it's my first plugin, so I need to figureout exactly how to do it :)Mitch

Yan,I have that tab in my "sexy bookmarks" already - I think this new likefeature is going to just be for the activity stream for the moment, but i'mnot sure - it's still really new.

Nah, that was my fault. Before it went into the repository i had it namedsomething different. Now, I had to rename it "SNV Facebook Like Button".Delete the old one and install the new one through the plugin installer :)

Nice work Mitch! I've added this to my blog.

Oh so easy to install and use! Thank you Mitch!

Can you give us the option to move the button up near the RT tab?http://AltaeeBlog.comThanks,

Is there a way to insert it manually? It's auto inserting to my content on the hompage and portfolio. :)

I had first thought it might show up on my profile page, in the feed, but it doesn't. Also interesting that you can't see the other people who Liked it. Anyway - very cool... I may give it a whirl on my blog.

Make sure you grab the new version from the repository and delete the one ifit's not "SNV Facebook Like Button" - that way I can get you updates :)Mitch

Mitch - I was literally looking for something like this two days ago...I am trying it out at Themarryblogger.com! Thanks!! (I put the regular 'like' button in my sidebar, and then added your plugin) I might take the like off of the sidebar totally.

I'm fixing that right now - once I do i've got access to the plugin directory and will upload an official version :)

Nice job! Easy install, seems to be working great!

Nice work Mitch! I've added this to my blog.

Trackbacks

  1. [...] *UPDATE 4/24/10: For a nice WordPress plugin to add the Like button to your individual posts(see mine below), visit:  http://www.studionashvegas.com/plugins/facebook-like-button-plugin/ [...]

  2. [...] con el mínimo esfuerzo; aquí van algunas recomendaciones:I like button widget for WordPressSNV Facebook Like Button PluginPueden buscar en el codex más información al respecto, y por supuesto más plugins. En últimas [...]

  3. [...] Well, I’ve gone and done it. I’ve installed a WordPress plug-in that adds a Like button to every post here on BlogCampaigning. (The plug-in is available via the WP directory, or via Studio Nash Vegas.) [...]

  4. [...] other Day Chris Brogan tweeted that he was installing the SNV Facebook Like plug-in by Mitch Canter of [...]

  5. [...] There was a request for a reliable way to add the Facebook LIKE button to posts.  One of our friends in Nashville created the one we use and we, well, we LIKE it: StudioNashvegas Like Button Plug-In for WordPress [...]