Herself's Webtools

Scripts, HowTos, Templates, Plugins, Widgets, Tips and Useful Information

Add Digg links to your Blogger and Wordpress posts

with 4 comments

First backup your template.

Go to Layout->Edit HTML and click download full template.

This uses small thumbs up icon from Digg. There are several icons available from Digg Buttons & Badges

<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/10×10-digg-thumb.png”

width=”10″ height=”10″ alt=”Digg!” /> Digg this</a>

The first part provides the link submission information. The second part is for the icon. If you want to change the icon just replace the second section of code with icon code from the Digg badge page.

Wordpress:
You’ll need to add this code to your index.php page.

Open that page and find the section: < div id=”content>
Then go down a few lines and find the post footer information, you’ll see ‘Posted in’ and ‘the author’ etc. Put the code after the last of the content information.

You will also want to add this to your pages ( page.php ). Again look for the < div id=”content> section and add it just before the end of that section.

Blogger
<span class=’post-labels’ style=’float:right;’>
<a expr:href=’”http://digg.com/submit?phase=2&url=” + data:post.url + “&title=” + data:post.title’ target=’_blank’>DiggIt!</a></span>

Go to Templates->Edit HTML then check Expand Widget Templates

Find:
<p class=’post-footer-line-3′/>

You want to put your Digg link just above that line. This link does not have an icon. You can grab an icon plus directions to add it to your link at the Digg badge page above.

That worked on 6 of my 7 blogger blogs. One blog I needed to post the link just above the line:
<!– quickedit pencil –>

*** To use the link with out an icon just use:

<a href=”http://digg.com/submit?phase=2
&url=<?php the_permalink() ?>
&title=<?php the_title(); ?>
&bodytext=<?php the_excerpt() ?>”
title=”Digg this story”>
Digg this</a>

See also:
How to add Del.icio.us Links to Blogger and Wordpress Posts
How to add Stumble Upon Links to Blogger and Wordpress Posts
How to add Reddit Links to Blogger and Wordpress Posts

Written by timestocome

May 4th, 2007 at 12:00 pm

4 Responses to 'Add Digg links to your Blogger and Wordpress posts'

Subscribe to comments with RSS

  1. Great tip! I’ve been searching for thi!

    adam

    18 Aug 07 at 3:00 am

  2. You’re welcome!

    herself

    18 Aug 07 at 3:48 am

  3. Thanks for the tip! I have cut and pasted the code into my wordpress index.php template but for some reason the php won’t let the url go straight to the site. Example: http://janishenderson.com/musings/”http://reddit.com/submit?url=http://janishenderson.com/musings/?p=30&title=On
    Any suggestions how to fix that? Thanks!

    luv_hikin

    3 Apr 08 at 7:46 pm

  4. Somethings not right.

    I just double checked and these links work fine on this WP 2.5 blog.

    Yours has your domain name in front of the link.

    I can only see the PHP output from your blog so I can’t see what the error is.

    Can you email me just your index.php template? I’ll be out of town Fri/Sat/Sun at a blogging conference but will take a look when I return or if I get some free time out there.

    ljmacphee

    3 Apr 08 at 9:17 pm

Leave a Reply

You must be logged in to post a comment.