How to: Add a simple Facebook share button to your Blog posts in 5 simple steps

There’s a plugin for everything nowadays in wordpress but some plug-in just doesn’t work like we want them to work.. One of them is the Facebook share-me plugin. Although it gives you a counter just like the digg button, sometimes its really hard to customize and share it in the place where we want it on the page. So, I figured out a way to add the Facebook share-me without a plugin and you can add it in 5 simple steps in your blogger or WordPress blog posts.

Things you need:

1. A Facebook share button, if you don’t have one use the image link below. [facebook share ]

http://hellblogger.com/img/share-me-fb-button.jpg

Here is how you can add Facebook share-me in just 5 simple steps:

For Blogger blogs:

1. Write your blog post

write a blogger post

2. Publish it

publish post

3. Now copy the published blog URL and Edit the published page again. [Eg. http://sharath-g.blogspot.com/2009/10/testing-facebook-share-plugin.html]

copy link blog post

4. Grab this code and put in your URL

<a href="http://www.facebook.com/sharer.php?u=ENTERYOURPOSTURLHERE"><img src="http://hellblogger.com/img/share-me-fb-button.jpg" alt="share to facebook button"></a>

5: Add the code to your post and republish the blog :)

Now try adding using the Facebook share button.

done adding facebook shareme

For WordPress blogs:

If you are adding Facebook share me to your Theme file, just add:

<a href="http://www.facebook.com/sharer.php?u=<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . ' ' . $_SERVER['QUERY_STRING']; ?>"><img src="http://hellblogger.com/img/share-me-fb-button.jpg" alt="share to facebook button"></a>

This below script is a PHP script which automatically inputs the URL of the page.

<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . ' ' . $_SERVER['QUERY_STRING']; ?>

Now isn’t that easy? :) Do you also have any such easy tips and tricks? Share it with us by posting comments below or you can contact us to send a tip!

About sharath g

A Blogger, Technologist, Coding geek and Founder of Hellblogger from Silicon valley, India! You can follow sharath on twitter - @thesharath or friend him on Facebook and Google Plus :)

, ,

5 Responses to How to: Add a simple Facebook share button to your Blog posts in 5 simple steps

  1. kaakaai December 22, 2009 at 2:45 am #

    I am definitely bookmarking this page and sharing it with my friends.
    :)

  2. Jason December 22, 2009 at 7:53 am #

    Very outstanding website.
    The message here is genuinely valuable.

    I will give it to my friends.

    Cheers

  3. neidelleriozy January 30, 2010 at 10:33 am #

    Very nice Blog, I will tell my friends about it.

    Thanks

  4. Red MicrowaveSwemernUttefe February 19, 2010 at 11:59 am #

    How’s things many thanks pertaining to your post.I really like your web site.Its extremely informative.Nevertheless I definitely want you to post how you put social bookmarking below your post.I like it simply because its a incredibly thoroughly clean awesome blogger hack.
    thank you really much

    • sharath February 21, 2010 at 9:17 pm #

      Thanks Cynthia :)

Leave a Reply

Got interesting tips that you want to share with Hellblogger readers? Signup for a Free HB account and start posting!