What is Facebook Like Button? Get Yours
The Like button enables users to make connections to your pages and share content back to their friends on Facebook with one click. Since the content is hosted by Facebook, the button can display personalized content whether or not the user has logged into your site. For logged-in Facebook users, the button is personalized to highlight friends who have also liked the page.
The basic Like button is available via a simple iframe you can drop into your page easily. A fuller-featured Like button is available via the <fb:like> XFBML tag and requires you use the new JavaScript SDK. The XFBML version allows users to add a comment to their like as it is posted back to Facebook. The XFBML version also dynamically sizes its height; for example, if there are no profile pictures to display, the plugin will only be tall enough for the button itself.
If your web pages represent profiles of real-world things — things like movies, sports teams, celebrities, and restaurants, you can optionally use the Open Graph protocol to enable users to establish lasting connections to your pages. Your pages show up in more places on Facebook and you gain the ability to publish stream stories to connected users.
The Facebook documentation doesn’t really go into any detail about what the generated code means, so I took the default sample and hacked on it to figure out what each parameter affected and how to best customize it to our own particular needs.

If you look at the default code that the generator outputs, it looks like this:
iFrame code:
<iframe src=”http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Farpitshah.com&layout=standard& show_faces=true&width=450&action=like& font=arial&colorscheme=light” scrolling=”no” frameborder=”0″ allowTransparency=”true” style=”border:none; overflow:hidden; width:450px; height:px”></iframe>
XFBML code:
<fb:like href=”http://arpitshah.com” layout=”standard” show_faces=”true” width=”450″ action=”like” font=”arial” colorscheme=”light”></fb:like>
So, in essence, the entire widget lives inside an iframe, whose content is generated entirely by Facebook’s servers. If you parse through and de-percent-encode the actual URL, you’ll find it makes an HTTP GET request to http://www.facebook.com/plugins/like.php with the following parameters:
href = http://developers.facebook.com/
layout = standard
show-faces = true
width = 450
action = like
font = arial
colorscheme = light
Look familiar? Those are all the same options that you can set with Facebook’s generator, albeit expressed much more densely. layout can be standard or button_count, show-facesis a boolean that corresponds to the “show faces” checkbox, etc.
Get your Like Button here: http://developers.facebook.com/docs/reference/plugins/like
Thanks,
Arpit Shah
Must watch Related Articles/Posts:
- Facebook Announces Open Graph API and 5 New Social Plugins at f8
- Facebook Rolling Out A New Slimmer Like Button
- Tweet Button Support added in Twitter Goodies WP Plugin
- Facebook Insights – Now in All in One Webmaster WP plugin
- Top 10 WordPress Plugins For More Traffic
View Comments to “What is Facebook Like Button? Get Yours”
Trackbacks/Pingbacks
- Arpit Shah - RT @arpitshah: What is Facebook Like Button? Add Yours #developer.facebook #facebook developer #Facebook Like Button http://bit.ly/ag9b3A
- TERESA ROMANO - RT @arpitshah: RT @arpitshah: What is Facebook Like Button? Add Yours #developer.facebook #facebook developer #Facebook Like Button http://bit.ly/ag9b3A
- Arpit Shah - Get your facebook like button & Enjoy: http://arpitshah.com/what-is-facebook-like-button-add-yours/ #arpitshah #facebook #likebutton #like
- uberVU - social comments - Social comments and analytics for this post... This post was mentioned on Twitter by arpitshah: RT @arpitshah: What is Facebook Like ...





RT @arpitshah: RT @arpitshah: What is Facebook Like Button? Add Yours #developer.facebook #facebook developer #Facebook Like Button http://bit.ly/ag9b3A
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.
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.
great post as usual!