It is no wonder with the explosion of Social Media Networkings, which are called web 2.0 as well in recent years.
Google, Facebook, Twitter, Flickr, Digg, and etc.
Many of them have become a very important part of our lives.
By adding social media buttons to your blog, your readers will easily share your posts with their friends. And it will truly enhance their experience and definitely boost your blog’s traffic.
Adding social media buttons to Blogger is not as hard as you imagine.
There are only three simple steps:
1. Open Blogger template and find out where to add social media buttons.
Go to Blogger’s Dashboard, find “Layout” section, then click on “Edit HTML” link.
After that, click on “Expand Widget Templates” checkbox.
Now find (CTRL + F) following line:
<div class='post-footer'>
2. Immediately after that line, add these codes:
<div class='post-footer-line post-footer-line-0'>
<b:if cond='data:blog.pageType == "item"'>
Share This:
<a expr:href='"http://www.facebook.com/sharer.php?u=" + data:post.url + "&t=" + data:post.title' rel='external nofollow' target='_blank'><img alt='Facebook' src='REPLACE YOUR IMAGE URL HERE'/></a>
<a expr:href='"http://digg.com/submit?url=" + data:post.url + "&title=" + data:post.title' target='_blank' rel='external nofollow'><img alt='Digg' src='REPLACE YOUR IMAGE URL HERE' /></a>
<a expr:href='"http://www.stumbleupon.com/submit?url=" + data:post.url + "&title=" + data:post.title' rel='external nofollow' target='_blank'><img alt='Stumble' src='REPLACE YOUR IMAGE URL HERE'/></a>
<a expr:href='"http://del.icio.us/post?url=" + data:post.url + "&title=" + data:post.title' rel='external nofollow' target='_blank'><img alt='Delicious' src='REPLACE YOUR IMAGE URL HERE'/></a>
<a expr:href='"http://twitter.com/home?status=Check this Out: " + data:post.url + " | " + data:post.title' rel='external nofollow' target='_blank'><img alt='Twitter' src='REPLACE YOUR IMAGE URL HERE'/></a>
</b:if>
</div>
3. Just replace “REPLACE YOUR IMAGE URL HERE” with your own social media icons’ url.
Click “SAVE TEMPLATE” button and refresh your blog page to see the effect.
Frequently Asked Questions.
Q: Where can I find free social media icons?
A: Visit my picasa album which is a category about social media buttons.
Q: I want to show these social media buttons not only below my posts, but also in my homepage.
A: Just remove line “<b:if cond=’data:blog.pageType == "item"’>” and “</b:if>” in that codes.
Q: Can I move these social media buttons position?
A: Yes, You can.
In Blogger’s “Edit HTML” textbox, added codes are just above “<div class=’post-footer-line post-footer-line-1′>”, you can move those codes to where above “<div class=’post-footer-line post-footer-line-2′>” or “<div class=’post-footer-line post-footer-line-3′>”.
79 Responses to “How to Add Social Media Buttons to Blogger”
Trackbacks:
- June 20, 2011: Blogging Resources: Tutorials and Links | Household6Diva
النجاح
it work fine with me, thx for share
Lana
Hi, Pep..
I’ve been trying your code and replace ‘REPLACE YOUR IMAGE URL HERE’ with the image URL from my photobucket album, but there is no share button appear in my blog..
do you have any idea to solve it?
could it because of my template?
which code actually I should use from my photobucket album : direct link, HTML code, or IMG code?
thanks for your help..
Pep
Replace “REPLACE YOUR IMAGE URL HERE” to code like this “http://xxx.xxx.com/images/xxx.jpg”
via
Hi i think i have all codes in check with all ur instruction but when I try to install it, I keep getting this error: 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.
Could you maybe point out what im doing wrong, pls?? Thank you v muchhh ur tutorial is awesome!!
Pep
It seems somthing wrong with attribute “src”, have you replaced ‘REPLACE YOUR IMAGE URL HERE’ to the real image URL?
via
yes ive saved the buttons i downloaded to photobucket and use that url.
Pep
Could you show me one example of your button’s url? I guess the error occurred by some irregular html tags.
via
via
its something like this
via
its something like this
” “
via
i cant get the url to show here
Pep
……
Try sending the codes via email (fish35#gmail.com) to me .
nazrul
Facebook Emoticons
Thank you for this.
nazrul
Facebook Emoticons
May P.
I would like to put them on the left hand side of my blog.. How could I do this? Please help. Thank you!
Pep
It depends on your blog template, just adjust the code in paragraph 2 to the proper position.
siti
Thanks for sharing,,,,,,,,,,,,,,,,,http://profit4king.blogspot.com/
Materi Dakwah Islam dan Kultum
very usefull for me, thanks
Saurabh
Thanx for the code helpful!!!
Derek
Great tutorial
It works for me.
http://tips-to-peep.blogspot.com
Efe
I own a blog also and tried for a while to have a working one. And I wanted to have one that doesn’t need to change from html. So I made one that works for me and hope it will work for you. It is done directly from AddGadget from Layout. I wrote a blogpost that describes how to. Check it out if you need
http://www.msuggestions.com/2011/10/how-to-add-floating-social-buttons-to.html
Yana
I’ve been searching for this hack for my blog, I will apply this to my blog.. and I hope this will works as well,, thank you!
Pep
Your are welcome, I hope so
Si kasep
Thank you for the tutorial.. This is great,,
najad
I can’t find the code in my blog’s template.can you help me how can i add this widget in my blog here is my blog url: http://www.crazygadgets4u.blogspot.com
Pep
Hi, I can find “<div class=’post-footer’>” in your source code, so just try searching “post-footer” in your template and follow the hints of this article.
najad
again i can’t find the “” and post-footer”.what should i do
Pep
I guess you can do something with the template , I have leaven blogspot and using wordpress now. So I’m sorry I can’t give u many help.
John
How do I delete this from my site… they were really useful when Blogger did not offer them, but now I want to offer what they have an cannot. Thanks for any help
Pep
Hey John,
just remove the codes you added, which listed in this post paragraph “2. Immediately after that line, add these codes:”
nurhi
how to get another Social Media Icons codes like myspace, RSS, blogspot,googlebuzz..do you have another codes?..if you have it..can you give to me..thanks
Pep
Sorry, I don’t have these codes, but you can find the corresponding code at those social media sites.
For example, you can find Google buzz code at http://www.google.com/buzz/stuff?hl=en
Abhishek
Thanks for all this but I have a problem
I can’t find the
i searched for it but it’s useless. is there any alternative tag to it and i am using not a preloaded blogger template but i got it somewhwere else. I think you can help me
Pep
Your HTML code was filtered by WordPress
I guess you can’t find the “<div class=’post-footer’>”, after visiting your blog, I think you can add those social media button codes after “<span class=’post-icons’>”
Joke
Hm, I thought it will works if I copy the code which already added in edit html as explained in that post and select new HTML/JavaScript gadget, but seems that’s not the right way to do this ;(
Pep
There are some strange and strict rules of adding code to Blogger, so I have migrated from it to WordPress.
Pep
Well, you can add a new transparent button which has the appropriate width from the left.
Or you can just add a CSS property of ‘A’ tag, ie. <a style=’margin-left:100px’ href=’….’ > .
Joke
Damn I was looking for that. Already works in my blog, Thanks for sharing, mate! I have a question- how to put these icons right from my header? They will look perfect there, have some free space exactly for such stuff. Do you know how to do that? Thank you1
Kimberly
Hey Pep,
I really want to give these a try and almost have it figured out, but I’m not sure what code to put for the RSS button to link to my RSS feed. Where would I put my feed URL in that code?
Thanks!
Pep
Hi Kimberly,
The code of feed button is something like this:
<a href=’http://www.poorgirleatswell.com/feed’ rel=”nofollow”><img alt=’Feed’ src=’image url of feed button’/></a>
hb
it didnt work for me.. the links were there…but no photos :S
Pep
Hi, you must change src=’REPLACE YOUR IMAGE URL HERE’ to you own photo URL.
hb
oh…thanx!
The Blogging Mom
yeah, it worked. Thanks, and do check out my website.
Much appreciated
Pep
scrappysue
3. Just replace “REPLACE YOUR IMAGE URL HERE” with your own social media icons’ url.
where would i find the URL? i downloaded some icons and they are PNG files.
Pep
Find the buttons at my picasa album
Use the URL of picasa album or download and upload the buttons to your own hosting and get your own URL.
mike
I’ve downloaded an icon pack and the buttons look great, but where would I find each button’s URL?
Pep
If you downloaded an icon pack, you have to upload them to your host or other web albums, such as Picasa first.
mike
Oh, I thought i could use them on my blogger blog.
Pep
You can, but you should upload your own icons first.
Gaurav N
The official Blogger sharing buttons are also available now. follow http://abtevrythng.blogspot.com/2010/07/adding-bloggers-official-sharing.html which shows how to enable them at the correct place. on top right of the post
Pep
Thank you for your sharing.
Sally
How can I get rid of button I’ve added?
Pep
Just remove the code you added
Sally
I added all the code and I don’t have any error messages, but nothing showed up. I copied the location of the picasa icons, I’m not sure it that’s the problem but it’s not working at all. There’s not even a space where it should be. How do I make this work?
Pep
By default, these buttons will only show up in the post page. Did you only check the result in home page?
Sally
I did just check the home page. I tested it and if I make a new post it shows up, but not on the home page which is what comes up if you go to my blog. I don’t even know how to get to the post page unless I just made the post. Is there a way I can make it be on the home page?
Eric
hi your code really helps! though it took me quite some time to finish it
any way thanks!
Pep
You are welcome
Gilliom-Monsieur Bandit
Hello,
I just finished adding social media buttons to my blog with the help of your tutorial. It took me two afternoons to get it done, because I know hardly anything about all this and the theme I use was giving me some trouble (it kept adding a red border around every image (every icon), which I didn’t want… When I finaly managed to figure out how to get rid of that, the rest was a breeze.)
Thank you very much for your tutorial. Best one I could find!
If you want to see the results, check out: http://monsieurbandit.blogspot.com/
Cheers!
Gilliom
Pep
Hello Gilliom,
I’m glad my post could help.
Yadira
Yay! That rocks! Thank you so much!
Pep
You are welcome:)
Anna
I entered all the code and this seemed to work perfectly, except for the display of icons – I had only empty boxes where these shd have appeared – I linked to your picasa – I know nothing about code and I’m sure my error was simple but I don’t know how to diagnose it – any suggestions?
Pep
You should replace “REPLACE YOUR IMAGE URL HERE” in the code to your own icons’ url, such as “http”//xxx.xxx.com/facebook.gif”
ViVi ✯ Bibzee
Great stuff you got there! Thanks!
Pep
John"Spanky"Stokes
Oh and how do I get the twitter button to work, yours does not work either
Pep
It works on my site
John"Spanky"Stokes
Hello Pep, great tutorial! Everything works awesome except the icons are floating a little high for my liking, is there a way to bump them down a little bit? Thanks,
the site is http://www.spankystokes.com
Pep
You can add some css code (such as style=”padding-top:2px”) to adjust the height.
Susan
Where do you add this code? Mine shows up on the blog when I put it on.
Pep
If the icons show up, just add some codes to img tags, like below:
<img alt=’Twitter’ style=’padding-top:2px’ src=’REPLACE YOUR IMAGE URL HERE’/></a>
You can also replace 2px with any other height size.
medicthree
I have the code installed on medicthree.com but nothing shows up…
Apparently only when the post is opened up does it show.
Pep
@medicthree
Pls reffer the second question in "Frequently Asked Questions".
THE Stephanie
It seems like this is the exact code I need, but when I try to install it, I keep getting this error:
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 reference to entity "t" must end with the ';' delimiter.
I've tried to correct the error, but can't seem to find the problem within the code. Can you help?
Pep
@ THE Stephanie
The reason why you got that error is the HTML code should be "&t=" not "&t=".
But after I posted this code, "&" is auto replaced by browser to "&".
However, I have modified my code and tested it on a temp blog. It works!
Sorry for my carelessness.