WordPress: The Best Tweet This Link Ever
Posted March 20, 2009 by Brian Cray
Reading time: About 0 minutes
With the right people sharing your blog entries on Twitter, you’ll receive a good amount of quality referrals. One way this occurs is a retweet from frequently retweeted people as seen here.
The other way is to make it super simple for readers to tweet your blog entry. That’s where this post helps. If you have a self-hosted WordPress blog, add this code to your /wp-content/themes/[current theme]/single.php file where you want your own “Tweet This” link. [TinyURL shortening code originally from here]
1 2 3 4 5 | <?php $shortenedurl = file_get_contents('http://tinyurl.com/api-create.php?url=' . urlencode(get_permalink())); ?> <a href="http://www.twitter.com/home?status=<?php echo str_replace(' ', '+', the_title_attribute('echo=0')); echo '+' . $shortenedurl; ?>" title="Share <?php the_title_attribute(); ?> on Twitter">Tweet This</a> |
1 Article references from other blogs
274
8 Article comments
Show/add comments