How to: Create a “send this to twitter” button

November 6, 2008 at 8:25 am

Some times ago, I shown you how to display your last twitter entry on your WordPress blog. Today, let’s create a button to allow your visitors to send the current post they’re reading to twitter.

Nothing hard with this recipe: Simply paste the following code on your single.php file, within the loop:

<a href="http://twitter.com/home?status=Currently reading <?php the_permalink(); ?>" title="Click to send this page to Twitter!" target="_blank">Share on Twitter</a>

Your readers are now able to send your post url to twitter! Hope it will bring you some traffic and new readers!

Thanks to BabyGotMac for letting me know about this nice code!

Tags: