How to add the Facebook Like button on your blog

Friday, April 30, 2010, 1:32 pm

If you haven’t heard the buzz Facebook recently released their Social Plugins. In their words:

Social plugins let you see what your friends have liked, commented on or shared on sites across the web. All social plugins are extensions of Facebook and are specifically designed so none of your data is shared with the sites on which they appear.

Out of many different choices, the Like button is my favorite. First it looks nice and clean as you can see below this post. Second it gives you instant promotion. Everytime a user clicks on it your post link will be posted on his/her Facebook profile.

Are you sold yet? Ok here’s how to add it on your blog. Just copy and paste this block of code under your post template:

<iframe src=”http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink()); ?>&amp;layout=standard&amp;show-faces=true&amp;width=530&amp;height=60&amp;action=like&amp;colorscheme=light” scrolling=”no” frameborder=”0″ allowTransparency=”true” style=”border:none; overflow:hidden; width:530px; height:60px”></iframe>

And you’re done. You can modify the settings here if you need to customize it. And if you have problems feel free to comment below and I will try to help you.

{ 5 comments… read them below or add one }

Vincent May 2, 2010 at 5:58pm

Yea, thanks for your summarize it.


JErm May 3, 2010 at 8:02am

no problem man..


Chad Myers Smith May 17, 2010 at 10:31pm

@JErm, I think Vincent was yanking your chain–like implying that you wrote this post just so you could have something to link to from Mashable and promote your blog.


JErm June 5, 2010 at 5:08am

i have a few blogs. i wrote it to document it so i won't forget how if i need it again in the future. also i like to share my findings with my few readers.


Jamal Panhwar March 23, 2011 at 6:09pm

Here is a java script to dynamically place the url in the like button



Leave a Comment