Thursday, May 26, 2011

Add Facebook Like Button to your Blogger.com (BlogSpot)

Facebook Like button is a great and easy way of sharing things that you like with your friends. If you have a blog on Blogger.com (BlogSpot) you can easily add a Facebook like button to any of your posts. Each post will have it's own Like button. This can help increasing the traffic of your blog.

Let's see how we can easily add Facebook like button:

Step 1: Editing out blog template as HTML:

  • press on: "Design" on your blog main menu.
  • Then press on "Edit HTML" on the upper sub menu.
  • Check "Expand Widget Templates" checkbox.
Step 2: Find the place in which Facebook Like button code should be entered:
Search for the String:
<data:post.body/>
Facebook Like button should be placed before this code.

Step 3: Put the following code in your blog template:
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<iframe allowTransparency='true' expr:src='&quot;http://www.facebook.com/plugins/like.php?href=&quot; + data:post.url + &quot;&amp;layout=standard&amp;show_faces=false&amp;width=100&amp;action=like&amp;font=arial&amp;colorscheme=light&quot;' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:450px; height:40px;'/>
</b:if>

After you save your template, go to one of your posts. You could see that a Facebook Like button was added right under the name of your post.

No comments:

Post a Comment