DISCLAIMER: this post is older than one year and may not be up to date with latest WordPress version.

Tweetmeme is a popular service that allow you to display “Retweet” button on your blog posts. Even if the code is easy to integrate on your single.php file, it can be very cool to create a shortcode that you can insert anywhere in your posts.

Paste the following code in your functions.php file in order to create the shortcode:

function tweetmeme(){
	return '<div class="tweetmeme"><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div>';
add_shortcode('tweet', 'tweetmeme');

Once done, you can display the Tweetmeme “retweet” button anywhere on your posts. In WordPress editor, make sure you are in HTML mode and insert the following:


When your post will be published, the shortcode will be replaced by the TweetMeme button.

Leave a Comment

Your email address will not be published. Required fields are marked *