Facebook recently launched the "Like" button feature, in a bid to gain more access to sites. This new feature enables users to share content with only one single click. The links to the pages will appear on users' profiles and on a friends' timelines. Facebook also changed the word "Fan" (for pages) to "Like". Facebook Devs say, "the average user clicks "Like" on nine pieces of content each month." So "vox populi, vox dei"! Here are some ways you can integrate Facebook's like button to your blog.

For Blogger

Put the following code where you want to show the button.
<iframe allowTransparency='true' expr:src='"http://www.facebook.com/plugins/like.php?href=" + data:post.url + "&layout=standard&show_faces=true&width=450&action=like&colorscheme=light"' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:450px; height:70px'/>

For 'Classic' Blogger

Put the following code where you want to show the button. (Update: This code is updated and works perfectly with Blogger. Thanks, Kristina!)
<iframe src="http://www.facebook.com/plugins/like.php?href=<$BlogItemPermalinkURL$>&layout=button_count&show_faces=true&width=75&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:75px; height:20px"></iframe>

For Wordpress

Put the following code where you want to show the button.
<iframe src="http://www.facebook.com/plugins/like.php?href=<?php the_permalink(); ?>&layout=button_count&show_faces=true&width=75&action=like&colorscheme=light" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:75px; height:20px"></iframe>

This is a really awesome feature Facebook has come up with. With a little tweaking, you can easily come up with what Facebook Blog shows in the sidebar (see the screenshot below).

You can read more about the API here.

Labels: ,

blog comments powered by Disqus