Manually Install Digg This to Your WordPress Theme

Disclosure: We are a professional review site that receives compensation from the companies whose products we review. We test each product thoroughly and give high marks to only the very best. We are independently owned and the opinions expressed here are our own.

3 Flares Filament.io 3 Flares ×

Building Traffic Through Digg! Earlier today I finally came to the decision that I wanted to add a Digg submit button the post page of Evolutionary Designs. Originally I really didn’t like the buttons, but after the redesign of the button and the site’s new look, it grew on me. In the past I used Digg Digg for Digg submission but the plugin did not look very good with my site’s theme, and playing with code didn’t seem to help.

Rcently I tried to get Dig Dig To work on the site after the programmer updated and added a lot more features. But I did not like results. After not having success with Digg Digg and several other plugins, I decided to grab the JavaScript and code the plugin directly to my post page like I did with MMO Social Network, Twitter Submit, and the StumbleUpon button.

So earlier this morning, I went out and found the Digg This Submit Button on the the Digg website. I then added this code to the single.php file on my theme. Adding the button is really that hard. It should only take a few minutes. The only thing with this code is, it does not style it to work with your theme. You will have to decide where you want to put the button and know a little CSS.

How to Manually the Digg This Button

Of course, you can go to Digg’s site and get the code, but their walk through is not complete and it can be a little confusing for a non coder. With this walk through, I try and break down and make it easy for anyone to do you. I will explain how and where to add the code. All you need to know is a little CSS if my example does not work, and little about WordPress file structure.

The first think you want to do is grab the JavaScript Code. Then decide what type of button you to want use. Then Code it. Or you can grab the code here, I have code for each button option for you to choose fromDigg This Button Options

Compact

[javascript]<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> [/javascript]

Medium

[javascript]
<a class="DiggThisButton DiggMedium" 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> [/javascript]

Large

[javascript]
<a class="DiggThisButton DiggLarge" 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> [/javascript]

Icon

[javascript]
<a class="DiggThisButton DiggIcon" 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> [/javascript]

Adding The Code To WordPress

Once you have the code you will need to go to your admin dashboard >>> appearance>>> Editor>>> Single.php. Once you have the filed pulled, copy the entire text to a word or notepad document and save it your desktop. This will be used as a backup, if you make any mistakes and can not find where the code was damaged. All you will have to do is remove the corrupted code (select all delete) and paste the original code back on the form.

BEFORE WE GO ANY FARTHER, BACK UP YOUR CODE!

Next We will need to decide where to put the code. In this example, I will put the code above content and floated right.  In order to this we need to place the code just before the content. Take a look at the printscreen. You need to look for a line code that tells you are at the beginning of the post. You will need for something like main content. Once you find that, you should something below that says post. Below that is where you want to add the code.

Digg This Code Placement

Here is the code I used to submit all of the voting buttons that are floated left. If you only want the Dig Code, then skip this part and grab the second set of code below

[javascript]
<!– backtype Code –>
<span style="margin: 0px 6px 0px 0px; float: Right;">
<div class="backtype_style">
<script type="text/javascript">
tweetcount_url = ‘<?php the_permalink() ?>’;
tweetcount_title = ‘<?php the_title(); ?>’;
tweetcount_src = ‘RT @element321:’;
tweetcount_via = false;
tweetcount_links = true;
tweetcount_size = ‘large’;
tweetcount_background = ‘FFFFFF’;
tweetcount_border = ‘CCCCCC’;
</script>
<script type="text/javascript" src="http://widgets.backtype.com/tweetcount.js"></script>
</div>
</span>
<!– End of backtype –>

<span style="margin: 0px 6px 0px 0px; float: Right;">
<script src="http://www.stumbleupon.com/hostedbadge.php?s=5"></script>
</span>

<span style="margin: 0px 6px 0px 0px; float: Right;">
<script type="text/javascript">url_site='<?php the_permalink(); ?>’; </script>
<script src="http://www.mmosocialnetwork.com/sites/all/modules/drigg_external/js/button.js" type="text/javascript"></script>
</span>

<span style="margin: 0px 6px 0px 0px; float: Right;">
<a class="DiggThisButton DiggMedium" 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>
</span>
[/javascript]

The code I use to style Digg is below. This code should work with most themes.

[javascript]
<span style="margin: 0px 6px 0px 0px; float: Right;">
<a class="DiggThisButton DiggMedium" 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>
</span>
[/javascript]

If not, then you will need to play with the margin. If you want to place it somewhere else then you will tell it float left. If you want at the bottom, the add the code the bottom of the code. You will need to add where it says /!post. This will be easiest way to get this to work.

Conclusion

So far I am still testing the code and noticed a few things. One of those is, the code still reads as if there are no votes even if there are votes before the plugin was added. The button worked before Digg made major changes to their site. My guess the code will either be corrected or the issue will resolve its self over the next weeks. If doesn’t resolve and stays this way, I will remvoe the plugin all together.

In general I do not like plugins or submit buttons that show the number of submits and that is mainly because it slows my site down. So, if you have a lot of vote buttons, this could slow your load time. I would try and keep to no more than three buttons. In the future I will removing more of these buttons, if not all them.

Image Source Grunge Social Media Icons

EvolutionaryDesigns.net runs on the Genesis Framework

Genesis Framework

Genesis empowers you to quickly and easily build incredible websites with WordPress. Whether you're a novice or advanced developer, Genesis provides the secure and search-engine-optimized foundation that takes WordPress to places you never thought it could go. It's that simple - start using Genesis now!


Take advantage of the 6 default layout options, comprehensive SEO settings, rock-solid security, flexible theme options, cool custom widgets, custom design hooks, and a huge selection of child themes ("skins") that make your site look the way you want it to. With automatic theme updates and world-class support included, Genesis is the smart choice for your WordPress website or blog.

About James

James spends most of his free time using social media and loves to teach others about design, web development, CSS, SEO, and social media. He is addicted to Wordpress, social media, and technology. You can reach him on his, personal website, Do not forget to follow him on Twitter @element321

Comments

  1. Awesome James.. Thanks for sharing the compact version. It fits in nicely in most blogs, and is not as in your face as the others. Love your floating sidebar icons as well.

  2. Comprehensive and detailed instructions, James. Great that we have you to sort this one out for us. I ditched Digg plugin after finding it’s not compatible with my site for a lot of reasons, this may give me another shot to try it again. Bookmarked! 🙂

    @wchingya
    Social/Blogging Tracker

    • Thanks Ching Ya,

      The Digg Plugin didn’t really work for me. I updated my theme and the coded version has to be restyled, but other than that its not a bad submit button to use.

  3. nice coding work James, I’ll do a little experiment on my blog and add the digg button to my theme… thanks for the guide!

    • Thanks Cindy, You will have to play with the code. I am redoing the code again. I am trying to decide where to put or even if I want to add back to the theme.

  4. Great tutorial but is it just me or has Digg in general been somewhat inaccessible lately. I have tried to digg a couple articles but it never connects and I have tried through different browsers.

    • Karen,
      Digg has done some major upgrades and redesign of their site. They have been getting a lot of weird errors throughout their site. I think the digg bar no longer works. but the submit buttons should still be working.

  5. I would love to hear a review of Digg as a whole from you. A few friends who were active Diggers quit in disgust over the changes. But I haven’t heard from people who are more active bloggers and designers, people involved in content creation more than promotion. Does the new Digg work well for them?

Trackbacks

  1. […] This post was mentioned on Twitter by Element321, Element321. Element321 said: Manually Install Digg This to Your WordPress Theme | Evolutionary Designs http://t.co/iRhaWPl via @element321 […]

  2. BloggerLUV says:

    Install Digg This to Your WordPress Theme With using a Plugin | Evolutionary Designs…

    Looking for a way to install Digg This submit button without using a plugin. Learn how to add manually the Digg this button to wordpress….

  3. Hardcode Digg This Submit Button to Your WordPress Theme…

    Now that Digg has been redesigned, take advantage of all the new users using Digg and hardcode Digg Submit buttons to your WordPress site….

  4. Manually Install Digg This to Your WordPress Theme | Evolutionary Designs…

    Learn how to install Dig This Submit Button to your website manually……

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

3 Flares Twitter 3 Facebook 0 Pin It Share 0 Buffer 0 Email -- Filament.io 3 Flares ×
%d bloggers like this: