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() ?>
tweetmeme_source = ‘<the name what you want to display before retweet post>’;
tweetmeme_style = ‘<size style>’;
tweetmeme_url = ‘<the post permalink>”;
For customization of the retweet button use the following scripts:
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:
tweetmeme_service = ‘bit.ly’;
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>
The above script will render a normal share count button within a post.
You can also try this,
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.
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.
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.
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… 🙂
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
I agree with you.. 🙂
I would say this is just brilliant and must for every blog owner to read this.
Thanks Suhasini ..
I’m glad you find the post useful.
Sometimes I use code direct in the page and sometimes plugin…so it’s all depends on blogger dat wat he preferred 😉
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.
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??
Are you using wordpress.If yes then replace YOUR_URL to the_permalink().
this is awesome mate, liked it. Thnx for sharing, will try it straight away.
try it and have fun..
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.
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:-
If still there is some problem let me know the more details what you are doing…
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 😉
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.
Was searching for one like this 🙂 thanks @saorabh. will implement one in my blog.
Thanks Robin For your comment..I am happy that you find this article is useful…
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