How to add facebook ‘like’ button to your wordpress blog?
Technical April 22nd, 2010Facebook has added the ‘Like’ functionality for the web that we all like so much (no pun intended!). And guess what, it’s dead simple to make each post on your blog likable.
Now, assuming you want to create this for each post on your blog (it makes little sense to like a category or tag or the blog itself, although it can be done! ), you just need to add this button on each post that you create. For that, all you need is the php file which is included only on single blog posts, and its permalink. For wordpress, the file is called ’single.php’ and is included within your theme. So browse to your wp-content directory, then your plugin’s name, and then edit the ’single.php’ in it.
The code that you will need on single.php can be generated here. Facebook presents to you a widget, through which you can create your custom ‘like’ button. In the ‘URL to like’, include <?php the_permalink() ?>, it’s the wordpress php code for generating URL for each post. Go ahead and change any other values you would like to tinker with.
Finally click on ‘Get Code’, and include this code in the ’single.php’ of your blog. You’re done!

It’s too simple to be missed even by the people who don’t know abc about php or wordpress, and the kind of virality this feature has is immense. Gone are the days when you used to customize your blog for keywords and optimize each post for search engines just to be seen and get more traffic. Facebook provides us with social sharing outside of facebook, even easier than tweeting, IMHO.
Bring down IE6!
April 22nd, 2010 at 6:07 pm
Works like a charm… thanks for this
April 22nd, 2010 at 6:16 pm
Glad that you liked it, Kosha
April 27th, 2010 at 2:55 pm
Here’s the Wordpress plugin:
http://wordpress.org/extend/plugins/like
No coding necessary, you can customize the look and placement of the button in the settings interface
April 29th, 2010 at 9:33 am
i m owner of shree krishna pooja bhandar vasai west.
July 2nd, 2010 at 8:31 pm
Good brief and this mail helped me alot in my college assignement. Thanks you as your information.