Recently digg launched the version 4 and many people want to put digg button on there wordpress sites and blogs. There are many wordpress plugins available for putting digg button on wordpress.
How to put digg button in wordpress without plugin
But I cannot recommend to use the wordpress plugin for putting the digg button.
You can use the following code in your wordpress theme for putting the digg button.
In loop you can use the following code.For Index.php file or archive.php or category.php you can use following code.
digg_url = '<?php the_permalink() ?>'; digg_title = '<?php the_title() ?>'; </script> <span><span><span> <span>0</span><a>digg</a></span></span></span>
In single page and pages or without loop you can use following code in single.php and page.php file. Use the following code.
<script type="text/javascript">// <![CDATA[ (function() { var s = document.createElement('SCRIPT'), <span class="hiddenSpellError" pre="" data-mce-bogus="1">s1</span> = document.getElementsByTagName('SCRIPT')[0]; s.type = 'text/javascript'; s.async = true; s.src = 'http://widgets.digg.com/buttons.js'; s1.parentNode.insertBefore(s, s1); })(); // ]]></script>
You can use various size of digg button in your wordpress site.
For above buttons you need to specify the button size in anchor class. as like following.
<script type="text/javascript"> (function() { var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0]; s.type = 'text/javascript'; s.async = true; s.src = 'http://widgets.digg.com/buttons.js'; s1.parentNode.insertBefore(s, s1); })(); </script> <!-- Medium Button --> <a class="DiggThisButton DiggMedium"></a> <!-- Large Button --> <a class="DiggThisButton DiggLarge"></a> <!-- Compact Button --> <a class="DiggThisButton DiggCompact"></a> <!-- Icon Button --> <a class="DiggThisButton DiggIcon"></a>
Great trick for adding the digg button code in to wordpress blog.
You might want to review your code as it is not working anymore. Thanks.
I will check this and update this soon.