Our Digg link works fine for submitting the content, but isn't very pretty, and does not show the number of Diggs we received. That is why we need to use a standard Digg button.
This is accomplished by using a simple piece of JavaScript code provided by Digg, and passing it the necessary information.
Let us implement a Digg button, using information from the Digg API. We will use the newly created button on single posts, and keep the simple Digg link for all the other pages.
Create a new function for displaying a nice Digg button using JavaScript code.
/* Return a Digg button */ function WPDiggThis_Button() { global $post; // get the URL to the post $link=js_escape(get_permalink($post->ID)); // get the post title $title=js_escape($post->post_title); // get the content $text=js_escape(substr(strip_tags($post->post_content), 0, 350)); // create a Digg button and return it $button=" <script type...