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:

  • YouTube Success: Key Tips for Enhancing Video Optimization and Visibility
  • Mobile App vs. Mobile Website Ideal Choice for your Business
  • Top Strategies to Boost Your Brand’s Visibility and Impact
  • Advanced Blogging Strategies: Using Analytics, A/B Testing, and Conversion Optimization Techniques to Grow Your Audience
  • Unlock Real-Time Process Insights to Save Time and Money
  • How Writers Can Attract More Audience Attention
  • Dress for Success – Even at Home
  • Mastering the Art of Crafting SMART Marketing Goals
  • Rediscover Your Brand Story: 7 Tips for Refreshing Your Company Identity
  • Creating Engaging Content: Tips for a Successful Content Marketing Strategy

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-2025 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.