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 :DDid 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...



















Chris - Add value to your WP blog posts with digg dugg
May 14th, 2007 at 6:36 amNice, May be the one I was after, still jealous of the hat
robwatts - Add value to your WP blog posts with digg dugg
May 14th, 2007 at 9:35 amIts a certainly a way of supplementing your existing content. Sometimes though there aren’t any stories, so I need to find a way of checking to see if a story exists and then insert a different kw if one doesn’t.
Hat can be purchased in accessorize in the UK, gotta be accompanied by ones 12 yr old daughter though