Integrate Facebook’s Like Button into WordPress
Facebook’s new Like The Internet takeover is underway. I think I like it despite privacy concerns. I can fiddle with my facebook privacy settings or simply choose not to ‘like’ stuff I don’t care to share. But, I can see the benefits for driving traffic bigtime.
I’ve been playing with it tonight and was having trouble getting the Like button to share a specific post. Instead, Facebook’s default iframe code that spits out is URL-specific. But with the miracle of PHP (and until someone creates a nifty plugin), you can substitute the URL with this:
…like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>
So instead of this:
<iframe src=”http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.stephanieromanski.com&layout=standard&show_faces=true&width=450&action=recommend&font=arial&colorscheme=light” scrolling=”no” frameborder=”0″ allowTransparency=”true” style=”border:none; overflow:hidden; width:450px; height:px”></iframe>
You get this:
<iframe src=”http://www.facebook.com/plugins/like.php?href=<?php echo urlencode(get_permalink($post->ID)); ?>&layout=standard&show-faces=true&width=500&action=like&colorscheme=light” scrolling=”no” frameborder=”0″ allowTransparency=”true” style=”border:none; overflow:hidden; width:500px; height:60px”></iframe>
Post this on your single.php page and voila.
—
[UPDATE] Well, I’m too slow. There already is a WordPress plugin
Get it here
Tags: Facebook, like button, Wordpress
For a MUCH easier way to do this with way more options use the the wordpress-facebook-like plugin:http://blog.steffanantonas.com/how-to-get-a-faceb…
Oh. Well this post is pointless then, hehe thanks a lot
Thanks for the article, especially adding it to one’s themes.
For everyone’s theme convenience, I have gone ahead and developed a plug-in that provides options to place the button at the top and/or bottom of the post: http://bit.ly/dDg0u5
[...] This post was mentioned on Twitter by Chip Oglesby, Stephanie Romanski. Stephanie Romanski said: [New Blog Post!] Integrate Facebook’s Like Button into WordPress – http://bit.ly/cCvaTb [...]
do you have an idea how to disable add comment feature from like button.
34aCpL http://dhY3n0fjvTtj48mG9sFnCv.com
your metropolis. From time to time the shop timings really don’t match your schedules, and at other occasions the store is oftenaware or alert in any way moments. You will discover wonderful presents that last just for an incredibly small period of time,faux and duplicate bags is expanding so swiftly, that it is actually easy for dealers to fool persons and obtain a whole lot offor your constrained preference of items. The main reason for your minimal decision is that the boutiques enter intofrom an internet based outlet store than an offline store. This truly makes impression after you think about this because heap beats dr dre factors are checked, it is possible to preserve your funds and acquire made use of bags instead of first ones.So girls, the nextthought to initial converse to somebody that has utilised that particular web page prior to. Can I Get Chanel Second Hand Bagsagencies, dealers, shop keepers etcetera. Moreover, you receive no cost around the globe shipping.Then, besides the originalmake your buy on line.For many who are looking at buying genuine Chanel items this kind of as an genuinefrom a web based outlet store than an offline store. This actually helps make impression when you imagine about it mainly because