Monday, October 15, 2007

Adding a Digg button to Blogger

After looking around for quite awhile and trying numerous 'solutions' that didn't work for adding a Digg button to Blogger posts (I'm referring to the pre-Beta or original Blogger, like I use here), I finally got it to work by using:

<script type="text/javascript">
digg_url = '<$BlogItemPermalinkUrl$>';
</script>
<script src="http://digg.com/tools/diggthis.js"
type="text/javascript"></script>


Just add the code to your template where you'd like the Digg button to appear (on the Minima template I use, I put it before the End .post tag).


Like so:
<script type="text/javascript">
digg_url = '<$BlogItemPermalinkUrl$>';
</script>
<script src="http://digg.com/tools/diggthis.js"
type="text/javascript"></script>

</div>
<!-- End .post -->