ButlerBlog

chad butler's weblog

  • About
  • Blog
  • WordPress Plugins
  • Contact
Home / Web / WordPress / Add a digg count to your WordPress posts

Add a digg count
to your WordPress posts

By Chad Butler 5 Comments

One of the things that originally attracted me to WordPress was the extensibility of plugins. But I have more recently come “full-circle” in my thinking seeking to do more without the use of plugins. Not that I don’t like plugins, but there are some simple tasks that are more efficient to do directly. Too many plugins unnecessarily slow down your blog, in my opinion.

So here is a way to directly place a Digg counter/link neatly aligned in your blog posts using CSS.

For this, I chose the “Digg This” button that you can see at the upper left of this post. This is called via Digg’s own javascript using this:

<script src=”http://digg.com/tools/diggthis.js” type=”text/javascript”></script>

I wanted to have this neatly wrapped in the upper left corner of the content. This is easily accomplished via CSS in a div tag:

<div style=”padding-right: 8px; padding-bottom: 4px; float: left;“>
<script src=”http://digg.com/tools/diggthis.js” type=”text/javascript”></script>
</div>

Where you place this is up to you depending on your theme. For me, this went in the single.php file just before WordPress outputs the post content with <?php the_content(); ?>.

You can easily add this to your theme using the WordPress theme editor. Go to the WP admin panel and select Presentation > Theme Editor. Using the Theme Editor, you can select the necessary theme file(s) from the right hand side. The single.php template is indicated by “Single Post.”

Enjoyed this article?

Don't miss a single post. Subscribe to our RSS feed!

  • Facebook
  • Twitter
  • Email
  • Print
  • More
  • LinkedIn
  • Reddit
  • Tumblr
  • Pocket
  • Pinterest

Filed Under: WordPress Tagged With: digg, tips, tutorials, WordPress

About Chad Butler

Chad Butler is a freelance writer and web developer. He has developed several popular WordPress plugins and has written for forbes.com, sfomag.com, and investopedia.com. He also runs a small organic farm in east Georgia.

Join Us!

I will never share your information. No spam. No junk. No kidding. Unsubscribe anytime.


Recent Posts:

  • The Right Product at the Right Time
  • Top 3 Time Wasters
    Keeping You From Success
  • Top 8 Tips to Create Your Own Website Easily With WordPress
  • How to Fix wp_mail
    Settings for WordPress Email
  • 7 Reasons Why Social Networking Can Help Your Business
  • Understanding WordPress wp_mail and
    how to fix it
  • Prevent WordPress email sent
    to spam with this
  • Easy wp mail SMTP settings for WordPress
  • The Importance of Supporting Developers
    of Free Open Source Software
  • How to Run an Effective Meeting





Archives

  • About
  • Blog
  • Archive
  • Contact

Site powered by WordPress, running on the Genesis Framework from StudioPress.

Unless otherwise noted, content on this site is © 2006-2021 ButlerBlog and may not be reproduced without express written permission from the author.

Some content may include affiliate links for which this site receives a small commission.

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.