I’ve been asked by a few people how I made my social sharing links on this site, (the ones that used to be seen right below the post title on single pages). It’s actually pretty simple, and I have no problem showing others how to do the same thing.
So let me run down the link code I used for each social network and explain how I did it.
<a href="http://twitter.com/?status=<?php the_title(); ?>%20<?php echo wp_get_shortlink(get_the_ID()); ?>" onclick="window.open(this.href); return false;">TWITTER</a>
For the twitter sharing link I opted to use the WordPress shortlink instead of the full URL in order to keep the tweet as short as possible. If a visitor decides to share my post on Twitter, a new window pops up to their twitter page that has automatically filled in a new tweet that includes the post title and the link to the post.
<a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>" onclick="window.open(this.href); return false;">FACEBOOK</a>
I did the same thing for facebook, except I used the full URL instead of a shortlink. Facebook handles their updates a little different than other sites, so space isn’t a problem. I have also done a little more customization in which image gets used on Facebook when a post of mine is shared, but that’s a post for another day.
<a href="http://reddit.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" onclick="window.open(this.href); return false;">REDDIT</a>
The Reddit sharing link works pretty well. When a visitor wants to share a post on Reddit, the submit screen will be automatically populated with the URL of their submission as well as a title. All that’s left is for them to choose which sub-reddit to submit it to.
<a href="http://digg.com/submit?phase=2&url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" onclick="window.open(this.href); return false;">DIGG</a>
The Digg submission link works much in the same way as the Facebook sharing link. Once clicked, the Digg submission screen is automatically filled with the post’s URL and title, as well as the selected image I already have in place from the Facebook customization.
<a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" onclick="window.open(this.href); return false;">STUMBLE</a>
When the StumbleUpon link is clicked, the user is taken to their stumble submission page with the URL already inserted. From there, the user just needs to select a topic and a review (if they choose to).
<a href="http://www.google.com/buzz/post?url=<?php the_permalink();?>" onclick="window.open(this.href); return false;">BUZZ</a>
The Google Buzz link also works like the Digg and Facebook sharing link. Once clicked, the user is taken to the Buzz submission page and the URL, description, and post image is automatically inserted and selected. A very clean and simple process.
<a href="mailto:?subject=<?php the_title(); ?>&body=Check out this article! <?php the_permalink() ?>">EMAIL</a>
There’s nothing too fancy with this link. If a user decides to send a post of mine to somebody via email, they can click this link and their default email program will pop up that has the subject line and email content prefilled with the info I included in this link. All the user has to do is enter a recipient. You can easily edit the body content to your liking by editing this sharing URL.
This is how I chose to implement social sharing for the material on this site. This may or may not suit your needs. If you want to have some visible metrics, like how often your posts have been shared, then you would want to either install a social sharing plugin to your WordPress site or use the default sharing scripts provided by some of these social circles.