Retweet, F Share & Google Buzz buttons on your Blog without plugins.

The motive of all three popular buttons is to share our idea with a community, people and friends on twitter, facebook and other social networking sites. These buttons show a neat count of the number of times your blog post has been shared.

Why the available Plugins shouldn’t be used ?

  • Plugins have a bunch of codes and images, which inturn increases loading time of your site.
  • It takes some extra space on your server.
  • All plugins are based or we can say designed on I Frame. This I frame results into error when tested on W3C validator.
  • The customization of the share buttons is impossible with plugins.

How to use share scripts?

Be sure to place the following code in your template page (within index.php, single.php, and /or page.php) or as per your requirement.

1) For Retweet button:

Go to home.php or index.php place the code before or after : <?php the_content() ?>

<script type=”text/javascript”>

tweetmeme_source = ‘<the name what you want to display before retweet post>’;

tweetmeme_style = ‘<size style>’;

tweetmeme_url = ‘<the post permalink>”;

</script>

<script type=”text/javascript” src=”http://tweetmeme.com/i/scripts/button.js”></script>

For customization of the retweet button use the following scripts:

Script Renders this button Size
<script type=”text/javascript” src=”http://tweetmeme.com/i/scripts/button.js”></script> 57×57 pixels
<script src=”http://www.twittlink.com/tools/button_b.js” type=”text/javascript”/></script> 57×57 pixels
<script type=”text/javascript” src=”http://widgets.backtype.com/tweetcount.js”></script
57×57 pixels
<script src=”http://twittley.com/button/button.js”></script> 57×57 pixels

Changing the URL Shortener used

We have also added the ability to use a URL shortener of your choice instead of our default one.

If you would like to do this then you need to include the “tweetmeme_service” parameter as shown below:

<script type=”text/javascript”>
tweetmeme_service = ‘bit.ly’;
</script>
<script type=”text/javascript” src=”http://tweetmeme.com/i/scripts/button.js”></script>

2) For facebook share count buttons:

Again go to home.php or index.php, place the code before or after <?php the_content() ?>


<a name=”fb_share” type=”button_count” share_url=”<pots permalink>”</a>
<script src=”http://static.ak.fbcdn.net/connect.php/js/FB.Share” type=”text/javascript”></script>

The above script will render a normal share count button within a post.

You can also try this,

Using this code Renders this button Size
<a name=”fb_share” type=”box_count” share_url=”YOUR_URL”></a> 57×57 pixels
<a name=”fb_share” type=”button_count” share_url=”YOUR_URL”></a>
96×18 pixels
<a name=”fb_share” type=”button” share_url=”YOUR_URL”></a>
56×18 pixels
<a name=”fb_share” type=”icon_link” share_url=”YOUR_URL”>Share</a> 51×15 pixels
<a name=”fb_share” type=”icon” share_url=”YOUR_URL”></a> 18×15 pixels

As for example
share_url= <?php the_permalink() ?>

Now its depends up to you that where you want to place the buttons. For doing this
Just put all the code within a <div> </div> and apply some CSS according to its placement.

3: ) How to use Google buzz

Go to home.php or index.php, place the code before or after <?php the_content() ?>

<a href=”http://www.google.com/reader/link?url=<post permalink>&title=<?php the_title(); ?>&srcURL=<?php bloginfo(‘url’); ?>” target=”_blank” rel=”nofollow external”>

<img alt=’Buzz It’ src=’http://i46.tinypic.com/ouprt1.jpg’/>

The following code will display the compact size of google buzz button.
The only thing is that make sure that URL have your post permalink.
As For Example: –
url=<?php the_permalink() ?>

You can change the default image according to your requirement, For high Resoultion Google Buzz Icons click here.

This is my first post, thanks for reading. Suggestions and feedback’s  are most welcome.

19 Comments

Gautam March 14, 2010

I am totally against your argument that plugins shouldn’t be used.

* Plugins have a bunch of codes and images, which inturn increases loading time of your site.
-> 1) Use cache plugin and WP Minify
2) If you have images on your server, then it is good as if any other host goes down, your website isn’t affected.

* It takes some extra space on your server.
-> Few KBs isn’t something hard!

* All plugins are based or we can say designed on I Frame. This I frame results into error when tested on W3C validator.
-> This script – http://api.tweetmeme.com/button.js in turn adds an IFrame.

* The customization of the share buttons is impossible with plugins.
-> Tweetmeme and Google Buzz (the one by Mashable) can be modified, never tried others.

This thing:
tweetmeme_source = ‘’;
tweetmeme_style = ‘’;
tweetmeme_url = ‘”;

Is automatically done by plugins for each post, so you don’t need to do this.

Finally, you can activate/deactivate/upgrade any plugin, any time with a single click.

saorabh March 15, 2010

HI Gautam
Thanks for your input and I agree with your point on cache and other things..
Though in this script image is being called from tweetmeme server so if that is going down.. Means tweetmeme service is down for a while…
The idea is to lower down the usage of plugins and rely on script..as Any plugin adds overhead to WordPress…
Thanks for useful comment, this will give more opinion from a dev point of view to DW readers… 🙂

Rishabh Agarwal March 14, 2010

@Gautam
All your points are valid buddy. But still, everyone is not the same. Some play with codes, other go the safe way. You’re absolutely right that plugins are there for all this stuff and they should be use. But this is not the only solution. Everyone SHOULD know how to play with codes and get things done WITHOUT any third party plugin.
Anyways, this is a very nice article because it covered everything, right from various icon sizes to perfect codes. I’m from the club, who always try to play with codes rather than installing one more plugin to the already over-loaded plugin directory 😛
Good job, Saorabh

saorabh March 15, 2010

Thanks Rishabh..
I agree with you.. 🙂

Suhasini March 14, 2010

I would say this is just brilliant and must for every blog owner to read this.

saorabh March 15, 2010

Thanks Suhasini ..
I’m glad you find the post useful.

VISHAL March 15, 2010

Sometimes I use code direct in the page and sometimes plugin…so it’s all depends on blogger dat wat he preferred 😉

saorabh March 15, 2010

That’s true Vishal.. Some bloggers are familiar with coding and some are not… Those who are familiar use codes else plugin are always there.. Thanks for your comment.

Chethan March 16, 2010

YOUR_URL… Please tell me what to replace here…. i m messed up…
i did with my website.com but i want to share individual post right?? everytime i need to change YOUR_URL for every post??

saorabh March 17, 2010

Are you using wordpress.If yes then replace YOUR_URL to the_permalink().

sidduz March 18, 2010

this is awesome mate, liked it. Thnx for sharing, will try it straight away.

saorabh March 18, 2010

Thanks bro,
try it and have fun..

meanderingthemaze March 18, 2010

I’m trying to add it, but nothing’s happening. Here’s what I put before/after on both index.php/single.php…nothing happens in any way i try.


saorabh March 19, 2010

First Thanks For your comment,
Now are you using wordpress if yes, then go to index.php/single.php, find the <?php the_content();?>, now place a <div> tag before or after that,Place the script either tweetmeme,fshare, or google buzz.
A example code:-

<div>
<script type=”text/javascript”>
tweetmeme_source = ‘meanderingthemaze’;
tweetmeme_style = ‘normal’;
tweetmeme_url = ‘<?php echo get_permalink(); ?>’;
</script>
<script type=”text/javascript” src=”http://tweetmeme.com/i/scripts/button.js”></script>
</div>

If still there is some problem let me know the more details what you are doing…

NPXP March 26, 2010

Well it depends on the blogger himself. If he is comfortable in going and editing the php files then it’s ok. But people need a quick fix. So plugins still rule the WordPress world 😉

saorabh March 29, 2010

That’s true NPXP…Those blogger who are familiar with coding this is useful to them…Those who are not familiar with coding, plugins are always there…Thanks for your comment.

Robin May 3, 2010

Was searching for one like this 🙂 thanks @saorabh. will implement one in my blog.

– Robin
DailyTUT

saorabh May 13, 2010

Thanks Robin For your comment..I am happy that you find this article is useful…

Kavita July 14, 2010

Thanks saorabh for the codes. But facebook small button code I am using is not showing facebook share count on page load but only when clicked on the facebook share button