Add digg links to WordPress

Just a quick hint on how to create a valid Digg this link for your WordPress posts without the need of installing any additional plugins:

  1. Find The Loop in your WordPress theme’s index.php and the post-entry part in your single.php
  2. Find the place where you would like to put your Digg this link. Somewhere right after
    <?php the_content(); ?>

    is mostly a good idea.

  3. Copy & paste this code:
    <a href="http://digg.com/submit?phase=2
     &url=<?php the_permalink() ?>
     &title=<?php the_title(); ?>
     &bodytext=<?php the_excerpt() ?>"
     title="Digg this story">
    <img src="http://digg.com/img/badges/10x10-digg-thumb.png"
     mce_src="http://digg.com/img/badges/10x10-digg-thumb.png"
     width="10" height="10" alt="Digg!" /> Digg this</a>
  4. Done.

The code creates a small Digg this link like the one you see on the left side below this post.

Of course you can customize the link and use any image (e.g. other digg buttons) and text you want.

Update

Meanwhile I installed the Sociable WordPress plugin, which does a wonderful job adding all sorts of social bookmarking sites to your post.

Possibly related posts

  • Thanks for the code, although I use Sociable as well, I was looking for the pure PHP-code solution to put on one of my non-Wordpress sites. (Yes, I know the code will have to be changed :-)

    Ann Arbor: That was actually a good idea. It would be great to follow the success!? (Or lack thereoff! :)
  • site metrics, such as clicky (aff link) or google analytics are a good start to analyse referrers and their produced traffic.
  • I also use the Sociable Plugin. It has worked great for me. I wanted to add the AddThis plugin, but had some trouble with the plugin being buggy. Now all they need is to create an admin plugin that helps you monitor the success of all of your social media submissions!
  • The list of icons you see below my posts is created by the sociable plugin. It's rather easy to use and configure and let's you add almost any social bookmarking site.
  • Oh is there any easy way to add the other submit it sites you have in your list like furl and sphere, etc... ???
  • All the plugins I tried would not work and this actually worked. It was also easy to implement. Thank you so much. :mrgreen:
  • Hmmm, just updated to WordPress 2.1 and this method still works fine. Since only very basic WordPress commands are used, I'd have been surprised if the WordPress developers had changed them for a 2.0->2.1 upgrade...
  • Matt
    Only problem is your next Wordpress upgrade will wipe this out completely though :(
  • Riz
    Many thanks! For the code :P
  • You're welcome!
blog comments powered by Disqus