Joe Levi:
a cross-discipline, multi-dimensional problem solver who thinks outside the box – but within reality™

HOW TO: Impliment DIGG's new "Smart Button" in WordPress

DIGG has released a “smart” version of it’s classic DIGG Button.

This new version will not only allow your site’s visitors to “DIGG This” right from your article, it also shows how many times your site has (or has not) been DUGG.

According to DIGG:

We’ve given our latest Digg This button a brain – it’s smart enough to:

  • Encourage users to submit new content from your site to Digg. We’ll detect if the content exists already and provide either a Submit or Digging interface
  • Display the real-time Digg count for content already on Digg
  • Support News, Video, or Podcast content.
  • Be backward compatible with the last version of our Digg This button

To implement this in your WordPress Blog you’ll need to add this line to your “Single Post” template (I’ve added some inline styles to an optional DIV to pretty it up a little bit):

<div style="float: left; padding-right: 4px; ">
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div>

That won’t work in your Main Index Template, however. You’ll need to tell the diggthis.js what the permalink to the article is, like so (again, DIV and styling are optional):

<div style="float: left; padding-right: 4px; "><script type="text/javascript">
digg_url = '<?php the_permalink() ?>';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></div>

The embarrassing part of this is your un-DUGG or little-DUGG articles will show your visitors just how few DIGGs you have. :: blush ::

Share

You may also like...

9 Responses

  1. Joe says:

    While you’re at it, check out BlogHerald’s WordPress Wednesday article. A must-read for any WordPress blogger.

  2. Joe says:

    Another good link for you: http://lorelle.wordpress.com/

  3. matt says:

    Thank you, thank you, thank you! I spent two hours unsuccessfully messing with various plugins and codes, and was about to rip my hair out before I finally found this post. You are a hero.

  4. Joe says:

    Matt,

    Glad to have helped! If you find anything similar, or have “spruced it up” a bit, please post it back here for the rest of us to benefit from.

    BTW: you’ve got some crazy funny stuff on your site (LSFW, but funny!).

  5. Brilliant, I’ve been struggling with so many crappy bits of code, and a mess of plugin’s. Stumbled across your site, 30 seconds later it was working! Thanks.

  6. Joe says:

    Darren,

    Glad to be of assistance. BTW, you’ve got some good bits on your site, too!

    http://www.JoeLevi.com

  7. Thanks for posting this – I was stuck on this issue for awhile.

  8. shzad1 says:

    I just added at http://www.BuildTutorial.com . Looks great

Leave a Reply