Share on Twitter link

Twitter bird

Ever wanted to give your readers, or your client’s readers a chance to share the post quickly on Twitter?

The code is straight forward:

<a href=”http://twitter.com/home?status=Currently reading http://www.test.com/post-url” title=”Click to share this post on Twitter”>Share on Twitter</a>

If you’re using Wordpress and want to automate this, simply use the following to insert the link to the current post in the loop into your link:

<a href=”http://twitter.com/home?status=Currently reading <?php the_permalink(); ?>” title=”Click to share this post on Twitter”>Share on Twitter</a>

Share this with friends:

Like what you've just read? Share it to your friends using your favourite service below:

Share on Twitter Share on Facebook Share on Stumble Upon Share on Google Share on MySpace Share on Delicious Share on Digg Share on Google Buzz Share via Reddit Share via E-Mail Share via Wordpress.com Share via Tumblr Share via Posterous Share via Newsvine

Comments:

  1. This post is very much helpful. Thank you.
    But, Instead of redirecting to twitter home and submit, I need, the status should be automatically updated. Can you please give any Idea?

  2. Hi, there is one issue that if I haven’t login yet, twitter will redirect to homepage with no status.
    Share on Twitter

  3. I would like to know … is there any way to shorten the URL as well using this method. A lot of our URL page is long.

  4. Hi. Thanks for the tips!

    I’m having problems passing a URL with the character “&”. i.e.

    ?status=Checkout+http://www.mysite.com/home?page=show_ad&adid=13

    Twitter ignores anything after & so only passes:

    Checkout http://www.mysite.com/home?page=show_ad

    Any suggestions?

Pingbacks/Trackbacks:

  1. 19th of August 2009

    [...] Vía ‘Share on Twitter’ link [...]

  2. 2nd of November 2009

    [...] específicos que sirven también para medir el número de veces se ha distribuido ese contenido: compartir en Twitter y compartir en [...]

  3. 29th of March 2010

    [...] where credit is due though: this is mostly the work of Jamie Huskisson and his Webtools. I just made a slight improvement so that the resulting code valids as [...]

  4. 3rd of April 2010

    [...] Here is the Twitter share code, which can also be found at http://www.jhuskisson.com/code-tidbits/share-on-twitter-link. [...]

  5. 9th of June 2010

    [...] in sharing mood by filling out a review, why not capitalize on the good vibes? You could create a simple link that sends the url of the page to their Twitter account to send, or use a Facebook share [...]

  6. 12th of June 2010

    [...] Source : Jamie Huskisson [...]

  7. 14th of June 2010

    [...] in sharing mood by filling out a review, why not capitalize on the good vibes? You could create a simple link that sends the url of the page to their Twitter account to send, or use a Facebook share [...]

  8. 4th of July 2010

    [...] in sharing mood by filling out a review, why not capitalize on the good vibes? You could create a simple link that sends the url of the page to their Twitter account to send, or use a Facebook share [...]

  9. 7th of July 2010

    [...] Here is the Twitter share code, which can also be found at http://www.jhuskisson.com/code-tidbits/share-on-twitter-link. [...]

Add a Comment: