Simple wordpress digg solution.

I have looked around the interwebs to find the easiest way to add a digg button with the sumbit feature to wordpress, but I could only find plugins, or other methods that seemed to complicated.

So here is the most simple solution for adding digg to you blog. The following is code from the digg website;

<script type=”text/javascript”>
digg_url = ‘WEBSITE_URL’;
</script>
<script src=”http://digg.com/tools/diggthis.js” type=”text/javascript”></script>

All you need to do is replace ‘WEBSITE_URL’ with ‘<?php the_permalink() ?>’ and place the code within the LOOP. (I put mine in the Main Index Template after the comments – you can edit this via wordpress in the theme editor.)

To show the Digg button when viewing a single post, you must also add it to the ‘Single Post’ template (also under theme editor). I placed this second set of code after the ‘tags’ and before the ‘postmetadata’.

Its as simple as that. For additional options you can add the following;

digg_bgcolor = ‘#ff9900’; (Background Colour)
digg_skin = ‘compact’; (Smaller Button)
digg_window = ‘new’; (Open in New Window)

For additonal options have a look at the digg tools website. (link)

7 Comments

  1. Thanks for the Help! I could set it up on my blog with no problems at all.

  2. Could you let me know where EXACTLY does the (compact code) go in the overall code, do we just add it at the end? Also what do you mean by place code “in the loop”?

    e.g. compact code: digg_skin = ‘compact’;

    Please specify.

    Missy.

  3. One more thing i really like the way you have your digg button set-up on your pages. Centered, bottom of post, and compact.

    Please let me know how i can add this to my blog(s).

  4. Sound like you have it right Missy, just add the skin bit at the end. “The Loop” refers to the wordpress loop, a part of the code that is “repeated” for every post (as is my understanding). As to where you should put it, I have put mine in the main index template – under the comment section.

    If you don’t have any luck, let me know and I’ll copy a bit of my template code as an example.

    Good Luck!

  5. works great, only drawback is it places the button on every page, including contact, advertise, archive, about, etc. where it probably doesn’t make much sense.

  6. Anthony, I’m not sure what you mean. The only place this appears is in the posts (or immediately after them). I haven’t seen the button appear anywhere out of place.

  7. And the answers to kommety be?

Leave a Reply

Your email address will not be published.

*

© 2017 Chris's Blog

Theme by Anders NorénUp ↑