WordPress – Create a Tweetmeme “Retweeet” shortcode

Send Us a Sign! (Contact Us!)
--> (Word) --> (PDF) --> (Epub) --> (Text)
--> (XML) --> (OpenOffice) --> (XPS)

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 [gs shortcode]:

function tweetmeme(){
return '<div class="tweetmeme"><script type="text/javascript" src="http://tweetmeme.com/i/scripts/button.js"></script></div>';
}
add_shortcode('tweetme', '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:

[tweetme]

Example

[tweet]

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

SOURCE

LINK (wprecipes.com)

LANGUAGE
ENGLISH