Pages

Subscribe Twitter Twitter

Monday, 29 November 2010

Add Facebook "Like" button on every post


The button code


<iframe

allowTransparency='true'
frameborder='0'
scrolling='no'
expr:src='"http://www.facebook.com/plugins/like.php?href="
+ data:post.url
+ "&layout=standard&show_faces=true&"
+ "width=530&height=60&action=like&"
+ "colorscheme=light"'
style='border:none; overflow:hidden; width:530px; height:60px'/>

where to add it ?

Log into your blogger account, then go to Layout >> Edit Html.
Before doing any thing you must check Expand Widget Templates box

In the edit box, find
<b:includable id='post' var='post'>.


And after it, paste your button code next to that code

Example:


<b:includable id='post' var='post'><iframe allow
Transparency='true' expr:src='"http://www.facebook.com/plugins/like.php?href=" + data:post.url + "&layout=standard&show_faces=true&width=530&height=60&action=like&colorscheme=light"' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:530px; height:60px'/>





click Save Template and you are done.

Update!
In case the code above is not working, here is the version with all the clarifying formatting removed and no line breaks:

<iframe allow
Transparency='true' expr:src='"http://www.facebook.com/plugins/like.php?href=" + data:post.url + "&layout=standard&show_faces=true&width=530&height=60&action=like&colorscheme=light"' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:530px; height:60px'/>



Warning! Manually editing your template can hose your entire blog if done wrong. Be sure to back it up (instructions are on the Edit HTML page), and don't blame anyone but yourself if you mess it up

GOOD LUCK!!!