Digg This Button Cheat Sheet
Digg has a pretty good tutorial page describing different ways you can implement the Digg This button on your own blog: http://digg.com/tools/integrate
However, that tutorial does not include previews of what the actual Digg badges look like for each set of code. Nor does it include the additional code needed to float your Digg badge to the left (or right) of your blog post text.
I'm posting this short cheat sheet showing the code for a couple standard uses of the Digg buttons — along with a preview of each result.
Like This Tip? Make sure you don't miss the new tips coming next week:
Weekly
Email Tips — or —
RSS
Feed (What's
RSS?)
#1: Basic "Digg This" Button
This is the simplest example of a "Digg This" button. Copy the code below and paste it into one of your blog posts (assuming your blogging package allows the use of <script type=" in the post). Replace the WEBSITE_URL value with the permalink for your particular blog post. This is necessary so your number of Diggs remains correct whether a reader is viewing the post from an archive page, or the actual permalink.
Basic: Copy and modify this code.
<script type="text/javascript">
digg_url = 'WEBSITE_URL';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript">
</script>
Float Left "Digg This" Button
Float Left: Copy and modify this code.
<div style="float: left; margin-right: 10px; margin-bottom: 2px;">
<script type="text/javascript">
digg_url = 'WEBSITE_URL';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript">
</script>
</div>
Float Right "Digg This" Button
Float Right: Copy and modify this code
<div style="float: right; margin-left: 10px; margin-bottom: 2px;">
<script type="text/javascript">
digg_url = 'WEBSITE_URL';
</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript">
</script>
</div>
Hope this is helpful to someone. I know it's made my own blogging life a little easier.