Wordpress "Tweet This" Link

By gilbitron in PHP on 25/02/2009 at 05:37

Views: 1488
Tagged: wordpress, twitter

Main Course:

<a href="http://twitter.com/home?status=I just read <?php the_permalink(); ?>" title="Send this page to Twitter!" target="_blank">Tweet This!</a>

Expand Report Code | Install Coda Clip

Please log in to vote.

Compliments to the Chef

  1. Comment by Sterling Hamilton on 25/02/2009 at 10:20

    Won't this only work if they are logged into Twitter?

  2. Comment by Gilbitron on 26/02/2009 at 00:34

    @Sterling What this does is take you to your twitter page with the content box already filled in. If you are not logged in you will be prompted to before you can post the tweet.

  3. Comment by Sterling Hamilton on 27/02/2009 at 23:22

    Ah - ok.
    Cool then.

  4. Comment by prisca on 13/04/2009 at 09:55

    hi :)
    thanks for sharing this (and the Coda clip - lovely!) - works perfectly on all pages/posts etc ;)
    Only have 1 problem and wonder if you might be able to help:
    I'm using the EventsManager Plugin and was hoping to use a 'tweet this' link on the event page - but no luck...

    The script till works but only transfers the main URL - not the full event page link, I think it might have something to do with the '?' appearing with the URL....
    Here is the page (site still work in progress and not officially launched just yet) - with the 'post to twitter' link: TwittLon event page

    Any ideas on how I could fix this?
    (I realise this is not about your script directly - but thought I'd ask anyway :) hope you won't mind)

    Thanks :)

  5. Comment by Gilbitron on 23/04/2009 at 14:45

    @prisca I'm afraid I don't know enough about what you are doing to be able to give an answer (and the link to your page doesn't work).

    Make sure the_permalink() is outputting the correct string. I can't see why ? in the string would cause an error. Otherwise I'm afraid I can't help much :(

How was your Meal?


  • Allowed HTML: <b><strong><u><i><em><a>

  • Why ask? It helps us stop spam comments.