The other day I added digg dugg to my list of plugins. Its pretty cool I like it. I was looking at a way of pulling in some related material to tag on to the bottom of my blog posts. I wanted to be able to plugin a keyword and pull posts from somewhere based upon whatever that word was. I looked at the digg duggplugin and thought cool, that might well work.
I couldn’t see a way of adding db variables straight off the bat into the digg dugg function, so after a little bit of fannying around with single.php I came up with this approach. (I may have missed something and wasted the past hour or so doing this, but what the hey, it works, Im happy)

If you want to display upcoming digg posts using the 1st tag that you used for your blog post. Then here is how you can do it.
After installing and activating the digg dugg plugin.
Pull out single.php from your wordpress blog theme.

In between the comments_template() and the endwhile lines place the code as shown.

[php]

function get_string_between($string, $start, $end){
$string = " ".$string;
$ini = strpos($string,$start);
if ($ini == 0) return "";
$ini += strlen($start);
$len = strpos($string,$end,$ini) - $ini;
return substr($string,$ini,$len);
}

$mytags= get_the_category_list($separator, $parents);
$mystring = get_string_between($mytags, '">‘, ‘‘);
$mystring=strip_tags($mystring);

echo”Top 5 upcoming $mystring related Digg Stories”;
dd_diggdugg(”, 5, 1, $mystring, ‘upcoming’);

endwhile; ?>

[/php]

Save it, upload it. Thats it. Done.

Your posts will now fetch the last 5 or whatever number you wish to specify upcoming posts relative to the 1st word you used to tag your original post.

Optional. You could also edit the digg dugg plugin which incidently has a bunch of cool features. and add the nofollow link option. In diggdugg.php just look for instances of a href type links and add rel=nofollow inside the tags.

If you really really liked this post you might even want to buy me a Stella Artois :D

Tell others: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Fark
  • Furl
  • digg
  • Reddit
  • Slashdot
  • Technorati
  • YahooMyWeb

Did this help? Do you agree? I value opinions, why not tell me what you think below!

Disclosure Policy
Do you need an experienced SEO Consultant or experienced SEO to work on your website? I may be available for hire...

RSS and Email subscription options for this post

Subscribe in Bloglines Add to Technorati Favorites

To subscribe to this blog and have posts delivered to your inbox enter your email address, you only get an email if I post a fresh blog post, I don't sell or trade your address either:

Delivered by FeedBurner