Showing posts with label Button Facebook. Show all posts
Showing posts with label Button Facebook. Show all posts

Sunday, January 12, 2014

How to Add Facebook Like Button to Blogger

After Facebook deprecated the share button, the Like button became one of the famous and widely used social sharing button as it let your blog readers to share your posts and articles with their Facebook friends with just one click.
Facebook Like button for BloggerWhen you will visit the official page you will find that there are two different versions ofLike button for which the implementation processes are also different. The most flexible one is XFBML but it requires a series of steps before it can be added to any webpage while Iframe version of the Like button is more easy to add. So here we will find out how it can be added to Blogger blogs.




Facebook Like button for Blogger

Step 1: Log in to Blogger and from the dashboard go to blog’s Template tab. Next click “Edit HTML” and check “Expand Widget Templates”.
Step 2: Find <data:post.body/> and immediately after or before it (or both if you want to have the Facebook Like button on top and also at the bottom of the Blogger posts) add the below code after selecting the options you like to have.

Button Options

Layout: 
Verb: 
Color: 
Font: 
  px

Float: 
Show for: 

Preview and code


<b:if cond='data:blog.pageType != &quot;static_page&quot;'>

<div style='float: none;'>
<iframe allowTransparency='true' expr:src='&quot;http://www.facebook.com/plugins/like.php?href=&quot; + data:post.canonicalUrl + &quot;&amp;send=false&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=35&quot;' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:450px; height:35px;'/>
</div>

</b:if>

Step 3: Save your template.

Attributions:

  • layout – There are three sizes avilable, options are ‘standard’, ‘button_count’ and ‘box_count’.
  • action – The text to display, that is, ‘like’ or ‘recommend’.
  • colorscheme – The colour of the button.
  • font – Font you like to use.
  • width – I have enabled this option for users who want to change the width of the Like button. If you don’t know the default widths as per Facebook standards then don’t change anything here.
  • show_faces – Option to show profile pictures of your Facebook friends (only) who have liked your post. I have set it to ‘false’. If you want then you can change it to ‘true’ but you also have to change the height accordingly.
  • send – This option is not available in Iframe version.

XFBML Like button

It is an example of XFBML (or HTML5) Like button which has the send button and also has a special feature, i.e. it will open a comment box whenever a user clicks it to Like an article.

How to Add Facebook Like Button to Blogger

After Facebook deprecated the share button, the Like button became one of the famous and widely used social sharing button as it let your blog readers to share your posts and articles with their Facebook friends with just one click.
Facebook Like button for BloggerWhen you will visit the official page you will find that there are two different versions ofLike button for which the implementation processes are also different. The most flexible one is XFBML but it requires a series of steps before it can be added to any webpage while Iframe version of the Like button is more easy to add. So here we will find out how it can be added to Blogger blogs.




Facebook Like button for Blogger

Step 1: Log in to Blogger and from the dashboard go to blog’s Template tab. Next click “Edit HTML” and check “Expand Widget Templates”.
Step 2: Find <data:post.body/> and immediately after or before it (or both if you want to have the Facebook Like button on top and also at the bottom of the Blogger posts) add the below code after selecting the options you like to have.

Button Options

Layout: 
Verb: 
Color: 
Font: 
  px

Float: 
Show for: 

Preview and code


<b:if cond='data:blog.pageType != &quot;static_page&quot;'>

<div style='float: none;'>
<iframe allowTransparency='true' expr:src='&quot;http://www.facebook.com/plugins/like.php?href=&quot; + data:post.canonicalUrl + &quot;&amp;send=false&amp;layout=standard&amp;show_faces=false&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=35&quot;' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:450px; height:35px;'/>
</div>

</b:if>

Step 3: Save your template.

Attributions:

  • layout – There are three sizes avilable, options are ‘standard’, ‘button_count’ and ‘box_count’.
  • action – The text to display, that is, ‘like’ or ‘recommend’.
  • colorscheme – The colour of the button.
  • font – Font you like to use.
  • width – I have enabled this option for users who want to change the width of the Like button. If you don’t know the default widths as per Facebook standards then don’t change anything here.
  • show_faces – Option to show profile pictures of your Facebook friends (only) who have liked your post. I have set it to ‘false’. If you want then you can change it to ‘true’ but you also have to change the height accordingly.
  • send – This option is not available in Iframe version.

XFBML Like button

It is an example of XFBML (or HTML5) Like button which has the send button and also has a special feature, i.e. it will open a comment box whenever a user clicks it to Like an article.

Add Facebook XFBML Like Button to Blogger

Blogger like button


Today we will learn how to add Facebook Likebutton to Blogger (XFBML/HTML5). After using the Iframe version, I was thinking if it could do something which will enable my blog readers to leave a comment while sharing.





So I checked and found out the JavaScript version of Like button which has a Send button too. When someone likes your post to share it with their Facebook friends, it will open a popupcomment box to leave a comment which will give it more prominence.
Facebook Like and Send button for Blogger
To get this you can visit the official page. Here I will try to explain it in simpler form.

Facebook Like Button for Blogger

Step 1. Log in to Blogger, go to Template tab, then click “Edit HTML” and check “Expand Widget Templates”.
Step 2. Though this step is not required as I have updated the rendering codes with HTML5 version but still you may include this for certain reasons. Find the highlighted HTML attribution:
<html ...... xmlns:expr='http://www.google.com/2005/gml/expr'>
After this, add XML namespace attribute so that it gets rendered without any problem in older versions of Internet Explorer.
xmlns:fb='http://ogp.me/ns/fb#'
Don't forget to give a space in between. The full attribution will be something as shown below:
<html xmlns:fb='http://ogp.me/ns/fb#' ...... xmlns:expr='http://www.google.com/2005/gml/expr'>
Step 3. Find <body> or <body expr:class='&quot;loading&quot; + data:blog.mobileClass'> and immediately after it add the following script:
<div id='fb-root'/>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
If your language is not English then to display your locale language replace en_US with the correct locale code.
Step 4. Find <data:post.body/> and after/before it (or both) add the below code after generating it.

Button options

Layout: 
Verb: 
Color: 
Font: 
 

Send: 
Show faces: 

Float: 
Show for: 

Preview and code


<b:if cond='data:blog.pageType != &quot;static_page&quot;'>

<div style='float: none;'>
<div class='fb-like' expr:data-href='data:post.canonicalUrl' data-send='true' data-layout='standard' data-show-faces='false' data-action='like' data-colorscheme='light' data-font='arial'></div>
</div>

</b:if>

Step 5. When it's all done, save your template.

Attributions

Attributes can be changed accordingly to fit in your requirements. Let’s have a look:
  • layout - there are three layouts of Like button and each of them has specific width which can be changed:
    • standard - it has the button to the left and social text to right.
      • The default width is 450 pixels while the minimum is 255.
    • button_count - which displays only the number of likes made for a particular post.
      • 150 pixels is appropriate if it has the Send button while without it the minimum width is 90.
    • box_count - which displays the total number of likes above the button.
      • Minimum width is 55 pixels.
    • If you use action ‘Recommend’ then the minimum widths will increase by 40px for all layouts.
  • action - additional attribution to display the verb:
    • like - it is default.
    • recommend - if you want to show ‘Recommend’ instead of ‘Like’ verb.
  • fonts - the font to use.
  • colorscheme - it's an additional attribution that can be used if you have a dark background. The options are ‘light’ (this is default) and ‘dark’
  • send='true' - if you want the Send button feature otherwise turn it off by send='false'
  • show-faces - This option will show faces of your friends only who have liked your posts.

Difference between XFBML and HTML5

You might have seen in the official page that there is also another option called XFBML. There aren’t many differences between XFBML and HTML5 Like buttons except the markup and HTML attribute that is required in step 2. In step 4, the codes get a little different, that’s it.
Conclusion
  • I have used the simplest method to add the XFBML/HTML5 Like Button, that is, without any use ofapplication ID.
  • Remove any old scripts for Facebook share buttons to let it work correctly.
  • If you want to skip all this, then add the simple Iframe version of Like button for Blogger.

Add Facebook XFBML Like Button to Blogger

Blogger like button


Today we will learn how to add Facebook Likebutton to Blogger (XFBML/HTML5). After using the Iframe version, I was thinking if it could do something which will enable my blog readers to leave a comment while sharing.





So I checked and found out the JavaScript version of Like button which has a Send button too. When someone likes your post to share it with their Facebook friends, it will open a popupcomment box to leave a comment which will give it more prominence.
Facebook Like and Send button for Blogger
To get this you can visit the official page. Here I will try to explain it in simpler form.

Facebook Like Button for Blogger

Step 1. Log in to Blogger, go to Template tab, then click “Edit HTML” and check “Expand Widget Templates”.
Step 2. Though this step is not required as I have updated the rendering codes with HTML5 version but still you may include this for certain reasons. Find the highlighted HTML attribution:
<html ...... xmlns:expr='http://www.google.com/2005/gml/expr'>
After this, add XML namespace attribute so that it gets rendered without any problem in older versions of Internet Explorer.
xmlns:fb='http://ogp.me/ns/fb#'
Don't forget to give a space in between. The full attribution will be something as shown below:
<html xmlns:fb='http://ogp.me/ns/fb#' ...... xmlns:expr='http://www.google.com/2005/gml/expr'>
Step 3. Find <body> or <body expr:class='&quot;loading&quot; + data:blog.mobileClass'> and immediately after it add the following script:
<div id='fb-root'/>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
If your language is not English then to display your locale language replace en_US with the correct locale code.
Step 4. Find <data:post.body/> and after/before it (or both) add the below code after generating it.

Button options

Layout: 
Verb: 
Color: 
Font: 
 

Send: 
Show faces: 

Float: 
Show for: 

Preview and code


<b:if cond='data:blog.pageType != &quot;static_page&quot;'>

<div style='float: none;'>
<div class='fb-like' expr:data-href='data:post.canonicalUrl' data-send='true' data-layout='standard' data-show-faces='false' data-action='like' data-colorscheme='light' data-font='arial'></div>
</div>

</b:if>

Step 5. When it's all done, save your template.

Attributions

Attributes can be changed accordingly to fit in your requirements. Let’s have a look:
  • layout - there are three layouts of Like button and each of them has specific width which can be changed:
    • standard - it has the button to the left and social text to right.
      • The default width is 450 pixels while the minimum is 255.
    • button_count - which displays only the number of likes made for a particular post.
      • 150 pixels is appropriate if it has the Send button while without it the minimum width is 90.
    • box_count - which displays the total number of likes above the button.
      • Minimum width is 55 pixels.
    • If you use action ‘Recommend’ then the minimum widths will increase by 40px for all layouts.
  • action - additional attribution to display the verb:
    • like - it is default.
    • recommend - if you want to show ‘Recommend’ instead of ‘Like’ verb.
  • fonts - the font to use.
  • colorscheme - it's an additional attribution that can be used if you have a dark background. The options are ‘light’ (this is default) and ‘dark’
  • send='true' - if you want the Send button feature otherwise turn it off by send='false'
  • show-faces - This option will show faces of your friends only who have liked your posts.

Difference between XFBML and HTML5

You might have seen in the official page that there is also another option called XFBML. There aren’t many differences between XFBML and HTML5 Like buttons except the markup and HTML attribute that is required in step 2. In step 4, the codes get a little different, that’s it.
Conclusion
  • I have used the simplest method to add the XFBML/HTML5 Like Button, that is, without any use ofapplication ID.
  • Remove any old scripts for Facebook share buttons to let it work correctly.
  • If you want to skip all this, then add the simple Iframe version of Like button for Blogger.

How to Add Facebook Share Button with Counter to Blogger

Facebook share button is a perfect way to share blog posts and to show the number of shares that has been made for a particular blog post. There are two types with different styles, one with a big count button and the other one is inline button. To add it to Blogger select any one of the share buttons as mentioned below.

Facebook Share Button with Counter



<div style="float: right; margin: 4px;">
<a name="fb_share" type="box_count" expr:share_url="data:post.canonicalUrl" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
</div>

Facebook Share Inline Button Counter


<div style="margin: 4px;">
<a name="fb_share" type="button_count" expr:share_url="data:post.canonicalUrl" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
</div>

Adding Facebook Share Button to Blogger

Go to Blogger Layout (Design) > Edit HTML and check the “Expand widget templates” box. Now find for <data:post.body/> and just above it add any one of the above mentioned codes and save your template.

Let’s have an explanation

In the above codes, find for “float: right;”. If you want to have this on left within your post body, then change it to “float: left;” or else delete it as shown in second button.
Share button float left
Share button float right
If you want the share buttons to be seen only for post pages, then put them into conditional tags. The code will be:
<b:if cond='data:blog.pageType == "item"'>
<a name="fb_share" type="box_count" expr:share_url="data:post.canonicalUrl" href="http://www.facebook.com/sharer.php">Share</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
</b:if>

Resizing Facebook Share Button

After the launch of too many share buttons, the Facebook share button looks somewhat over-sized. After a small CSS tweak, this button can be resized to match the width with other buttons. To do this find ]]></b:skin> and before it add:
.FBConnectButton_Text {
padding: 2px 4px 3px !important;
}
That’s it. If you like this post then don't forget to share it.

Labels

1 column 2 column 3 column 4 column aaSolah Accessories add button subscrise for blogger Add Digg Button to Blogger add feedburner for blogger add like button facebook to blogger Add Pinterest Pin it Button to Blogger add sitemap blogger to google add stumbleUpon badge to blogger Ads Ready afghan afghan stitch AGULHAS AMIGURUMI Anchor text Ảnh đẹp Ảnh vui Animasi applique Art artikel Árvore de Natal em croche Aulia baby crochet Baby Dress baby knitting Baby learn bag Bags Bài viết BAKTUS Ballet Bun Cover balloons BARRADOS Bayi Bead Beads Bear Ear Hat BEBÊS belts Berita Berry Best WP Theme 2014 Better Blogger Seo Biologi Black blanket Blogal Template Blogger Codex Blogger Images Slider blogger navbar Blogger Rating blogger template 2014 Blogger Templates Blogger Tool Tip Blogger Tutorials Blogger Widgets Blogger-Template Blogspot Blogspot Templates Blue BLUSAS BOINA BOLEROS BOLSAS books BORBOLETAS Bounce Rates bows boxes bracelet Brown Browse Business Butterfly Button Counter Button Facebook CACHECOL CACHECOLAR cake candles candy Candy Cane Cards carving carving fruit carving fruits CASACO INFANTI CASACOS CASAQUINHO EM CROCHE CASAQUINHO EM TRICO CASAQUINHO PARA BEBÊ Cerpen CHAPEU clay COLAR COLAR DE FLORES COLETE coloring Competitor Research Contact Form for Blogger CORDÃO CORUJUINHAS crafts CROCHE COM SAQUINHOS PLASTICOS CROCHE IRLANDES Crochet Crochet Geek crochet pattern cross stitch Curtain customize cutting paper DECORAÇAO Design blogger template Dicionário de Trico - Inglês/Portugues Digg button Dijual Documentation Doily Domain dress dwell time earring ECHARPE Ecommerce Embroidery ENXOVAL PARA BEBÉ ESTOLAS Event Exit Rates facebook facebook button facebook like in blogger facebook share button facebook share button with counter FAIXA PARA CABELOS fashion Favicon for blogger feed rss Felt Fisika Flat News Templates FLORES Flower flower arrangement flowers crochet Folding paper FOLHAS food food decor Foto Free Blogger Templates Free Download Blogger Templates FREE FORM Free Premium frustration Funny Galaxy Stitch Gallery Games garden Gaya Hidup gel grips Geografi gift Gifts Girl glass Go Green GOLINHAS Google Google Analytics Google Merged All Accounts into One google plus button Google SERPs Google Webmaster Tools Google+ Google+ comment GORRO GRÁFICOS Granny Square Gray Green hair clip Haji Hama hats Heart Hexagon hide blogger navbar holiday craft holiday crafts home and garden Hook how to how to add favicon for blogger how to add feedburner How to install flat news how to turn off google plus comment how-to-guides Hunian Iklan Baris Ilmu Pertanian Image Thumbnail for Blogger imam Indexed Quickly for blogspot iNews 2014 Blogger Template Info Kontes Installing Blogger Template Internet Iseng Islam Itunes jewelery jewelry Karma Blogger Template Kata Bijak Kata Mutiara Kesehatan Kewarganegaraan Keyword Research Kiếm tiền kirigami Knit knitting knitting pattern knot Kuliner Landing Page Blogger Templates Lập trình Blogspot Latent Semantic Indexing LEAVES Like button facebook Lirik Lagu LirikNasyid Log Cabin Square LSI LUMINÁRIAS LUVAS LUVINHAS PARA BEBÊ Magazine Magazine Blogger Template make up making flower making flowers Making toys Manta MANTA PARA BEBÊ MANTA PARA SOFÁ Mashable MEUS MOMENTOS MEUS TRABALHOS mittens motif Motivasi Movie Multiples Music Nail art Nature necklace News News blogger template News Google News Pro Blogger Template Nivo image slider Olah Raga On page seo Online store Orange Organik Origami Pagerank painting PANTUFAS PAP Paper Patchwork PELERINE Penyakit Tanaman Peribahasa Personal Phần mềm pictures Pilihan Pillows Pink plastic POLAINA PONCHO Popcorn Popular Posts Popular Posts Code For Blogger Portfolio post automatically to twitter Premium Blogger Teamplates professional blogger templates Profil puff stitch Puisi pumpkin cap QUADRADO Quilling paper Quilt RECEITA RECEITA CULINÁRIA RECEITA DE PONTOS recycle recycling Red redirected to FeedBurner Related Post Widget remove navbar blogger RENDA DE PELO DE CABRA repair work Responsive Blogger Template retweet button ribbon rings rss for blogger rugs SACOLAS SAIAS DE CROCHE SANDÁLIAS EM CROCHÊ SAPATINHOS SAPATINHOS PARA BEBÊ Sastra Scarf scarves search engine optimization Search engine users seo Seo Blogger Template SEO Course Outline Seo For Blogger SEO Friendly Seo in 2014 Seo tips Seo Tutorial Seo Tutorial 2014 Seo With Blogger Serba Info Serba Tips serps sewing share button share twitter button shawls shoes and sandals Simple Singing sitemap blogspot sitemap page skirt Slider for blogspot snood Snowflake soap socks SQUARE steps to design a nice blogger template Strawberry subscrise button SUÉTER sweater Swiffer Sweeper Cover Syahira blogger theme TABELAS DE MEDIDAS DE TRICO E CROCHE tablecloths Tanaman Padi TAPETES. RECEITA Template TENIS PARA BEBÊ Thank you the panda update Thủ thuật Tien Nguyen tip tips Tips and Tricks TOALHAS TOUCAS TOUCAS PARA BEBÊ Travel TRICO Từ điển Blogspot TÚNICA tunisian turn off google plus comment Tutorial Tutorial Blog Tutorial video twitter button Twitter follow button twitter for blogspot underwear Valentine's day Vegeta Blogger Templates Video VÍDEO Video Blogger Templates video tutorial weaving Web 2.0 wedding Wedding Mag what is a bounce What Is Anchor Text what is bounce rate What is Seo White WIDGET Widget For Blogger wood Wordpress Look WordPress Themes XALE Yellow Youtube