A Web Design Community curated by Chris Coyier

A little dab'll do ya

Code Snippets

Home » Code Snippets » WordPress » Automatic Social Media Links Submit one!

Automatic Social Media Links

This would go inside the loop, probably underneath the_content(), probably in your single.php file.

// bookmark on Delicious
<a rel="nofollow" href="http://delicious.com/post?url=<?php the_permalink(); ?>&amp;title=<?php echo urlencode(get_the_title($id)); ?>" title="Bookmark this post at Delicious">Bookmark at Delicious</a>

// submit to Digg
<a rel="nofollow" href="http://digg.com/submit?phase=2&amp;url=<?php the_permalink(); ?>" title="Submit this post to Digg">Digg this!</a>

// tweet on Twitter
<a rel="nofollow" href="http://twitter.com/home?status=<?php echo urlencode("Currently reading: "); ?><?php the_permalink(); ?>" title="Share this article with your Twitter followers">Tweet this!</a>

// submit to StumbleUpon
<a rel="nofollow" href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php echo urlencode(get_the_title($id)); ?>" title="Share this post at StumbleUpon">Stumble this!</a>

// share on Facebook
<a rel="nofollow" href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&amp;t=<?php echo urlencode(get_the_title($id)); ?>" title="Share this post on Facebook">Share on Facebook</a>

// submit to Blinklist
<a rel="nofollow" href="http://blinklist.com/index.php?Action=Blink/addblink.php&amp;url=<?php the_permalink(); ?>&amp;Title=<?php echo urlencode(get_the_title($id)); ?>" title="Share this post on Blinklist" >Blink This!</a>

// store on Furl
<a rel="nofollow" href="http://furl.net/storeIt.jsp?t=<?php echo urlencode(get_the_title($id)); ?>&amp;u=<?php the_permalink(); ?>" title="Share this post on Furl">Furl This!</a>

// submit to Reddit
<a rel="nofollow" href="http://reddit.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php echo urlencode(get_the_title($id)); ?>" title="Share this post on Reddit">Share on Reddit</a>

Reference URL

Subscribe to The Thread

  1. Krinkle says:

    Awesome !

    This is an great collection of usefulness here.
    All the major links and codes we need to either use as-is or built or (sprite-powered ;-) ) GUI-version of it.

    Thanks !

  2. Thanks for making these links available in a form any web publisher can understand — I’ll try to make my own, more customized, images to link with these social bookmarking sites!

  3. Ben says:

    I can’t get these to validate, anyone know what I might be doing wrong. This is the message I get,

    “general entity “t” not defined and no default entity”

    I’ve created a facebook share button on a wordpress blog.

  4. Jauhari says:

    Big Thanks to make it easy to include to our Coda App ;)

  5. Domdel says:

    Nice post! Very helpful indeed!

  6. Thanx a lot buddy.
    Isnt there any app which submit to these sites automatically with minimal interaction possible?

  7. James Mark says:

    thanks to sharing social bookmarking button good post

  8. Great! This is the way to do without any plugins :)

  9. Ahmad says:

    this nice code however all goes no to ready plugins its easy to be used

  10. Wow dats great …….. no need of JS and plugins in wordpress

  11. Nice list – However the Twitter one doesn’t seem to work anymore.

    This one does:
    http://twitter.com/share/?text=description+text&url=http://my-url.com/ – And it automatically runs it through Twitters shortlink service as well..

  12. MQ Hidayat says:

    to twitter, I prefer to use tweetmeme, because the count from twitter.com sometimes invalid.
    thank you for this information.

It's Your Turn

At this moment, you have an awesome opportunity* to be the person your mother always wanted you to be: kind, helpful, and smart. Do that, and we'll give you a big ol' gold star for the day (literally).

Posting tips:
  • You can use basic HTML
  • When posting code, please turn all
    < characters into &lt;
  • If the code is multi-line, use
    <pre><code></code></pre>
Thank you,
--- The Management ---