How To Create Your Own TweetMeme Button

08.05.09 by Jerome in Tutorials

How To Create Your Own TweetMeme Button

For a few weeks I was using the Tweetmeme button on my blog to put my posts on to Twitter.  It worked great and was really easy to implement with just few lines of javascript. But one thing was really bugging me.  Everytime someone retweets a message to Twitter, Tweetmeme were adding their own Twitter ID @techmeme to the Twitter message promoting not only your blog post but themselves also.

So a big thanks goes to SharkSeo.com for finding a great solution. Now you can create your own retweets button with just one line of PHP.  You can also shorten your post URL on the fly and promote your own Twitter ID.

Firstly create your own retweet button.  Be imaginative and create something catchy. Open your single.php page, place your Twitter button where you want it to appear and add this code around your retweets buttons

<a href=''http://twitter.com/home?status=RT @yourname <?php the_title(); ?> - <?php echo get_bloginfo ('url'); ?>/go/<?php echo $post->ID ?>your retweets button</a>

Don’t forget to change the @yourname with your own Twitter username. Next you need to create your own URL shortener- create a folder named “go” within the root of your domain.

Then make a .htaccess file, open notepad and drop the following code:
RewriteEngine On

RewriteRule ([0-9]+) /index.php?p=$1 [R=301,L]

RewriteRule (.*) / [R=301,L]

Save it as a .txt and then upload it to the “go” folder on your server. Then rename it to .htaccess. That’s it!

Related posts:

tweetmeme, twitter, wordpress

Get More Wordpress Tips & Tricks

Liked this post? subscribe to our email updates or RSS feed!

  • http://blog.freshegg.com/ jaamit

    Good stuff, and a great solution from SharkSEO.

    Although you gotta give it to tweetmeme for creating the ultimate piece of “tweetbait”!

    One thing missing from this mod of the tweetmeme button is the “no of retweets” counter – any chance you could include that? That would be awesome!

  • http://blog.freshegg.com jaamit

    Good stuff, and a great solution from SharkSEO.

    Although you gotta give it to tweetmeme for creating the ultimate piece of “tweetbait”!

    One thing missing from this mod of the tweetmeme button is the “no of retweets” counter – any chance you could include that? That would be awesome!

  • http://www.leecolbran.co.uk/ Lee Colbran

    Nice one Jerome,

    I agree with Jaamit, it would be great to have a counter in place.

    Lee

  • http://www.leecolbran.co.uk/ Lee Colbran

    Nice one Jerome,

    I agree with Jaamit, it would be great to have a counter in place.

    Lee

  • http://fearlessflyer.com/ michael soriano

    Whaa? its that easy to create a url shortener! Let me try this to see if works. If it does – you just won a subscriber.

  • http://fearlessflyer.com michael soriano

    Whaa? its that easy to create a url shortener! Let me try this to see if works. If it does – you just won a subscriber.

blog comments powered by Disqus