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

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

by teamgpt
Spread the love
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://usegpt.in/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://usegpt.in/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://usegpt.in/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!

Comments are closed.