Post Pic

Add a Facebook “Like” button to your WordPress blog

Facebook is one of the largest and more popular websites of the world. Althought I do not have an account there, I figured out many of you would be interested in knowing how you can ad a “Like” button to your blog. That’s very easy, just read this recipe.

Open your single.php (or any file where you'd like the "Like" button to be displayed), and paste the following code:

<iframe src="http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&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:450px; height:25px"></iframe>

That's all. Once the file saved, the facebook "Like" button will be displayed. A live demo can be seen on Visiter New York.

3 Responses

Jul 14 2011 09:42

I tried installing the code on the website I’m working on but whenever I “liked” the link, it won’t work. I wanted the Like button to appear on the main page/home page.

http://statusmagonline.com/gosee/

Help?

Aug 04 2011 18:36

This works perfect… loved it

Nov 19 2011 23:18

This did not work me either.

Trackbacks:

Leave a Comment

* Name, Email, Comment are Required

WP Theme of the week

Sponsored Likebox