How To Add XFBML Send Button Below Blogger Title?


In the previous post we saw how to enable a Facebook like button for all the Blogger posts. Today, we shall learn how to implement a Facebook send button below Blogger post title.

Remember that what was implemented in the previous like button tutorial was using an <iframe> tag. But send button has been upgraded to be XFBML version.

Here is a picture of how it works:

It just needs a click to start functioning. Click on the send button, type in the name of the friend, group or mail address you want to send and type in the message and click on send. Done!!!

Here is the official link to create a send button for your site/Blogspot.

Here is an example for my setting:

Do not enter any URL if you are going to implement it under the post. If you want it for your blog or particular link, then enter the URL and click “Get Code“.

In the next pop up you see HTML5, XFBML and iFrame.
Let’s try it out with XFBML, which is more powerful and works wonderfully.

We see 3 sets of codes:
1. A script
2. An XML tag
3. Facebook Send Plugin Code.

Backup the template before proceeding.

Let’s implement all the 3 set of codes into the Blogger template and make it work cool.

Step 1. Go to Dashboard > Choose Blog > Template > Edit HTML > Expand Template Widget.

Step 2. Adding the SCRIPT
It should look something like the one shown below:

<div id=”fb-root”></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); = id;
  js.src = “//”;
  fjs.parentNode.insertBefore(js, fjs);
}(document, ‘script’, ‘facebook-jssdk’));

Search(Ctrl+F) for <body> and just after it paste the above shown code.

Step 3. Adding XML
In the Template HTML, Search(Ctrl+F) for “<html
You should see something like this:

<html ………………………………………………………………………… xmlns:b=’’ xmlns:data=’’ xmlns:expr=’’>

Add the XML code at the end as :

<html ………………………………………………………………………… xmlns:b=’’ xmlns:data=’’ xmlns:expr=’’ xmlns:fb=’’>

The code in RED has been obtained from Facebook “Get Code”.

Step 4. Adding Final Facebook Plugin Code
In the Template HTML, search(Ctrl+F) for <data:post.body/> and just before it paste the Facebook plugin code as:

<b:if cond=’data:blog.pageType == &quot;item&quot;’>
<fb:send expr:href=”data:post.url” font=”arial” colorscheme=”light”></fb:send>

The above code is gonna get you the send button below all the Blogger post titles.

The best part of XFBML code is that it automatically fetches the post URL without entering any URL while generating the code.

1. To change colorscheme, change colorscheme=”light” to colorscheme=”dark”

2. To display the social widget on Home page of Blogger as well:
Remove the conditional tags <b:if cond=’data:blog.pageType == &quot;item&quot;’> and </b:if>

3. To display it on all pages except static pages, then wrap the code with this conditional statement as shown below:


<b:if cond=’data:blog.pageType != &quot;static_page&quot;’>
<fb:send expr:href=”data:post.url” font=”arial” colorscheme=”light”></fb:send>

4. Default font is arial – font=”arial”. Other fonts are:



Hope you enjoyed doing this on your Blogger blog. Thanks for reading. We will look into more into social networking in the future. If you have any doubts, please feel free to stay in touch with me via comments are you can also contact me via the contact form.


Previous articleHow To Add Facebook Like Below Blogger Post Title?
Next articleHow To Verify Address Using PIN On Adsense? Adsense Account on Hold
Karan Vyas is the founder at, Completed his B.Tech in ECE. He is passionate blogger, Web Developer having vast knowledge on Reverse engineering, Programming, Search Engine Optimization. He's Certified Ethical hacker as well due to his Interest. Apart from this he has knowledge in Witchcraft Black magic and Hypnotism.