Monday, April 26, 2010

Adding Facebook 'Like' button to blogger blogs

1. Go to Blogger Layout and select Edit HTML

2. Click on "Expand Widget Templates"

3. Search for <data:post.body/>

4. Just after the above, paste the following in a single line. That's it..
<script> 
document.write('<iframe src="http://www.facebook.com/plugins/like.php?href=&layout=standard&show_faces=true&width=450&action=like&font=verdana&colorscheme=light"scrolling="no"frameborder="0" allowTransparency="true"style="border:none; overflow:hidden; width:450px;height:80px"></iframe>'); 
</script>

5 comments:

Nandana Mihindukulasooriya said...

Great, it is good to read it and try it out in the same blog post :)

Mahasen Bandara said...

That's cool!
Thanks for sharing!

Anuradha said...

Good work.I just tried it in my blog. But I got this error

"We were unable to preview your template

Please correct the error below, and submit your template again.

Your template could not be parsed as it is not well-formed. Please make sure all XML elements are closed properly.
XML error message: The value of attribute "src" associated with an element type "null" must not contain the '<' character."

How can I make it work?

Prabath said...

Hi Anuradha;

Seems like the content you copied is bit wrong..

You only need to have script tags and the content within those - and should be in a single line...

Thanks & regards.
-Prabath

Denis Weerasiri said...

@Anuradha,
I had the same issue,
But this script worked for me, with the Prabath's steps.

Best
ddweerasiri