Previously we wrote an article on how to add twitter button to blog homepage,so similarly today we going to write on how to add digg button to your wordpress homepage without a plugin.

To add a digg button on homepage or anywhere on your wordpress blog all you need to do is put the following code where you want the button :

<a class="DiggThisButton DiggCompact" href="http://digg.com/submit?url=<?php the_permalink() ?>&title=<?php the_title(); ?>&bodytext=<?php the_excerpt(); ?>"</a>
<script src="http://widgets.digg.com/buttons.js" type="text/javascript"></script>

There are four types of designs available to use :

To use any of them on your blog just put the following classes :

<!-- Wide Button -->
<a class="DiggThisButton DiggWide"></a>
<!-- Medium Button -->
<a class="DiggThisButton DiggMedium"></a>
<!-- Compact Button -->
<a class="DiggThisButton DiggCompact"></a>
<!-- Icon Button -->
<a class="DiggThisButton DiggIcon"></a

Hopefully, this will help you .Enjoy

Do you like this post?

About

Bishwajeet Mahato is the Founder and CEO of Comptalks, an online portal and offline college magazine.He loves writing about technology and helps people solve their computer related problems. Nowadays, he is also interested in digital marketing and has worked for several top notch companies. Follow him on Twitter @mahato99

Comments:
  1. rohan @techlunatic.com

    how much impact does it have on the sites load time? ofcourse its a more viable solution than a plugin anyday but still the code uses classes and gives a function call to javascript which wil again impact site load time.
    You can achieve the same result and a faster load time if you use Inherent wordpress shortcodes. just place the short code in ur functions.php file and call the function name in your post whenever you want. This script has zero downtime since it is loaded last(after the page has downloaded) and hence no reduction in speed.
    You have still presented a viable option to those who dont want to mingle with php codes, this one is a bit easy to pull off. Dugg and submitted:)

  2. home Jobs

    thanks for sharing the source code

  3. Pharma Machinery

    very Interesting

    Nice Design

    Thanks

    Vial Labeling Machine

Leave a Reply

(required)

(required)


Copyright © 2008-2012 Comptalks - All Rights Reserved.