Skip to Content

Add Twitter Button to WP

Recently Twitter announced its own twitter share button. Now we dont need to rely on tweetmeme to share blog with twitter.
Here is how you can add it to your WP template….

Copy the below code in your index.php or single.php file in your WP theme files.

<a href="http://twitter.com/share" class="twitter-share-button" data-url="<?php the_permalink() ?>" data-text="Currently reading <?php the_title(); ?>" data-count="horizontal" data-via="ektz" >Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>

Change data-via=”ektz” to your own twitter username to add your twitter link in the generated tweet.

You can also recommend another twitter account for people to follow. Please add data-related=”randomattic” just after data-via=”ektz” phrase.

say bye to tweetmeme. welcome twitter.

 
 

Add your Comment

Our apologies, you must be logged in to post a comment.