Twitter today released their Twitter Button and until release of a WordPress plugin ( I have written a WordPress plugin )I have put together the following code to add the new button to your site.

In your theme files, simply paste the following code where you want the button to appear.

<div style="float: left; margin-right: 10px; margin-bottom: 10px;">
<a href="http://twitter.com/share" class="twitter-share-button" data-url="<?php echo get_permalink(); ?>" data-text="<?php echo the_title('','',false); ?>" data-count="vertical">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</div>

Note: Must be within the loop.

Thanks to TwisterMC for some amendments

About the author Daniel Taylor

Dan Taylor is the founder and owner of Tailored Internet marketing. With more than 5 years in SEO Dan has worked with and for brands such as MoneySupermarket, JJB Sports, ManUtd.com and others. Dan is a father of two, and avid Everton FC fan.

2 responses to “Adding The Twitter Button to Your WordPress Blog”

  1. Alok Arora says:

    Hi,

    I have been using your plugin. When we click tweet the tweet count increases, but it resets when you refresh page. If count is 0 and you click tweet it increases to 1 but when you refresh page it again displays0. can you please advise what is wrong. Following is the code we are using.

    Tweet

    Thanks and Regards,
    Alok

    • Dan Taylor says:

      Not sure what is happening here, will look in to it. However what I can say is that all my plugin does is add the code that Twitter provide. If there is an issue at their end then I am not in control of that.

      Dan