The quick and dirty way to add a Facebook Like button to your WordPress blog

Facebook have opened up its Like functionality, allowing you to Like posts all over the web and hence automatically post your Likings to your Facebook account. Adding this to your WordPress blog is really easy, this code snippet is all you need:

[php]<iframe src="<?php the_permalink();?>%2F&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:400px; height:40px;"></iframe>[/php]

Put that in your WordPress theme template wherever your want the Like functionality to be shown. This is usually single.php or index.php, depending on theme and setup. It will add an iframe with the Like button, being 400 pixels wide and 40 pixels high. You can hack that yourself with the width and height parameters at the end of the code.

Of course you could hunt down a plugin as well, there are a few, but I can’t vouch for anyone as I haven’t tried them out myself. If you have a recommendation, do speak up in the comments below.