Add Digg badge to Wordpress
I was having a hard time finding a good Wordpress plugin for a Digg badge. I know that Digg might almost be past it’s prime, but I think it’s still a useful tool in advertising your posts and increasing your site’s page rank.
So I checked out the Digg Tools section of the Digg.com website. I grabbed some code and added it to my site’s template. It was super easy. Here is how you can add your own custom Digg badge to all of your posts.
As many Wordpress professionals know, if you’d like to edit your site’s theme, it’s as easy as logging onto your admin account, clicking on “Presentation” and clicking on “Theme Editor.”
From here you can select the different pages of your theme to edit. Most themes include a link to “Main Index Template” and “Single Post”
Main Index Template is the front page of your blog. The Single Post is the display of one post (like when you view only one post from your blog).
I wanted my Digg badge to show on each of these pages, so I edited both templates to include the following code:
[code lang="html"]
[/code]
I placed this code within the Wordpress Loop, inside the entry container and after the call for the content:
[code lang="html"]
[/code]
You might also notice I wrapped the Javascript within it’s own div and gave it a class of diggBadge so that I could style and position my badge as I see fit.
Hope you find this useful!
2 Comments so far ...
Finally! This was the first Digg badge to actually work for me. Although I did need to view the page source to see the code.
Comment on June 7, 2008 07:36 amBest wishes! Thanks, for the post.
Comment on September 9, 2008 03:01 pm