Knowledge is good only if it is shared. As a new blogger, I have learned to change the Web template, and found out the tips, tricks, hacks, and tweaks of altering the Blogger template, customizing CSS, widgets, layout, blog design, inserting JavaScripts, HTML codes, Google AdSense, and other settings the hard way, through many trials and errors. For the purposes of this guide, I have started with the new “Minima” template. As I make the changes or learn something new, I shall document them. Before changing any template, please remember to save a copy of the current template. After editing the template, preview it, and save it when you are satisfied with the change. Hope this guide will help those who are finding the way around, just like me.

Search Tips for New Bloggers

Search World-Wide-Web

We have extended our month-long vacation by a couple of days. We shall be posting articles the moment we return. We noticed that Google had updated the Page Ranks. New bloggers who have been waiting anxiously for this can check their blogs' Page Ranks. We have the PR checker link in our SEO Tools - Search Engine Optimization article.

The blog we created recently in Aug 2007, Blogger FAQ and Help, has also got its first Page Rank, a PR4. All our blogs are now ranked:-

Tips for New Bloggers - PR6
Business Fables and Management Lessons - PR4
Famous Motivational and Inspirational Quotes - PR4
Blogger FAQ and Help - PR4

Thanks to everyone for the support!

Mar 18, 2007

Digg This Story

Add Digg button to Blogger or Blogspot

This is a step-by-step guide to automatically place a real-time Digg count and vote button to every single blog post. Digg is a social content website where your readers or you can submit content to. If you have a good story, members will 'digg' the post and write comments. As a blog owner, you may want to make it easy for and encourage your readers to submit and digg your articles.

Automatic Count and Vote Button

Before you do that though, you would want to take note of the following:-

1. Your blog should be set to save Post Pages. Post Pages are archived blog posts published to their own web page. Each post will have a unique URL, which is required by Digg for the individual posts to be submitted. To verify or enable it, login to your Blogger Dashboard. Under Settings-> Archiving, set the “Enable Post Pages?” to “Yes” and save the settings.

2. This template hack will put a Digg button to every post. You are therefore not able to choose which post you want to include or exclude a button. If you would prefer to have a Digg button added only to some posts, read the later part of this article on “Button for selective posts.”

3. The code reads the URL of the individual blog page and this shall be the URL used for submission of the story to Digg.

Under “Template”, click the “Edit HTML” tab. Block copy the entire HTML code for your site and save it in a text file. You can also click the "Download Template" link. This is one of the two necessary steps whenever you want to change the template. The second step is of course to “Preview” the new changes, and save the changes only when you are satisfied. The backup you have saved in a text file will come in handy when you accidentally click to save the changes without previewing them. With a backup, you can easily restore the template to the prior state if need be.

Add Digg button to Blogger or Blogspot

Click the box next to “Expand Widget Templates”. Scroll about two-thirds down the template to look for the code that reads:-

<p><data:post.body/></p>




If you want the button to show at the top right corner of your post, replace the above code with this.

<div style='float:right; margin-left:10px;'>
<script type='text/javascript'>
digg_url=&quot;<data:post.url/>&quot;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>
<p><data:post.body/></p>


This is what you get:-

Add Digg button to Blogger or Blogspot

If you would like the button to appear at the end of your post, replace with this following code instead.

<p><data:post.body/></p>
<div style='float:right; margin-left:10px;'>
<script type='text/javascript'>
digg_url=&quot;<data:post.url/>&quot;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>


The result will be this:-

Add Digg button to Blogger or Blogspot

If you want to have the button at the top left corner of your post, change the alignment.

<div style='float:left; margin-right:10px;'>
<script type='text/javascript'>
digg_url=&quot;<data:post.url/>&quot;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>
<p><data:post.body/></p>


The outcome is this:-

Add Digg button to Blogger or Blogspot

Digg has another compact button. If you insert this code:-


<div style='float:right; margin-left:10px;'>
<script type='text/javascript'>
digg_url=&quot;<data:post.url/>&quot;;
digg_skin=&quot;compact&quot;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>
<p><data:post.body/></p>


You will see a compact Digg count button like this:-

Add Digg button to Blogger or Blogspot

You can also change the background color of the button to blend with your site. For example, a code like this:-


<div style='float:right; margin-left:10px;'>
<script type='text/javascript'>
digg_url=&quot;<data:post.url/>&quot;;
digg_bgcolor=&quot;#BDEDFF&quot;;
digg_skin=&quot;compact&quot;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>
<p><data:post.body/></p>


will give you this:-

Add Digg button to Blogger or Blogspot

You can insert the color code of your choice into the red portion. For a list of color values to insert, you may refer to the Hexadecimal HTML color code list.

Automatic Count Button in Blog Footer

[Update] This segment is added in response to user's request to have the Digg button in the Blog footer, i.e., after the labels. If you scroll through your template, you will see this chunk of code which gives the labels in your Blog footer.

<p class='post-footer-line post-footer-line-2'>
<span class='post-labels'>
<b:if cond='data:post.labels'>
<data:postLabelsLabel/>
<b:loop values='data:post.labels' var='label'>
<a expr:href='data:label.url' rel='tag'><data:label.name/></a><b:if cond='data:label.isLast != "true"'>,</b:if>
</b:loop>
</b:if>
</span>
</p>


If you want a Digg button to appear just after the labels, add the appropriate Digg button code right after the above code. For example, if you want the compact Digg button, add this code below the labels code:-


<div style='float:right; margin-left:10px;'>
<script type='text/javascript'>
digg_url=&quot;<data:post.url/>&quot;;
digg_skin=&quot;compact&quot;;
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>


The resulting layout is this:-

Add Digg button to Blogger or Blogspot

Move the Digg button code above the labels if you'd like. Experiment a little. Just remember to preview the template and not to save it unless you are satisfied.

Digg Button in Blog Footer

If you do not want to see an Automatic Count button, you can also place a link button into the template. This button will appear at the bottom right corner of every post and readers can click it to submit that post to Digg.

Scroll to this part of the template and insert the lines (in red):-

<div class='post-body'>
<p><data:post.body/></p>
<div style='clear: both;'/> <!-- clear for photos floats -->
</div>

<div style="float:right; margin-left:10px;">
<a expr:href='"http://digg.com/submit?phase=2&amp;url=" +
data:post.url + "&amp;title=" + data:post.title'
target='_blank'><img border="0" alt="Digg this" src="http://digg.com/img/badges/91x17-digg-button.gif"/></a></div>



With the code, this is what you will see at the end of every post.

Add Digg button to Blogger or Blogspot

You can change the position of this button. Go through what we discussed earlier in this article to understand where to place the code if you should want the button to be at the top of the article.

The button 91x17-digg-button.gif is simply an example. As the following section explains, there are many buttons you can use. To change the button to another design, replace the image URL with that of the new button.

Button for selective posts

The methods of manually adding a Digg button to selective posts are rather tedious and complicated. The problem is that Blogger does not allow you to simply insert a JavaScript into a blog post. Since this blog is targeted at the majority of us who are not computer experts, I shall suggest a method that I think is simple enough for us.

First, go to the Digg tools site to select a Digg button that you like. You will see a wide selection of Digg buttons.

Digg Digg Digg Digg Digg Digg

Digg Digg Digg Digg

Digg

Take note of the image URL. For example, the image URL of this button Digg is

http://digg.com/img/badges/91x17-digg-button.gif


Write a post and publish it. Next, refresh the page and click on the title of your post. This will bring you to the post page. Take note of the new URL of your story. Insert it into the orange portion of this HTML code. If you want a different image, insert the image URL into the blue portion of the code.

<a href="http://digg.com/submit?phase=2&url=URLofyourstory" target="_blank"><img border="0" alt="Digg my article" src="http://digg.com/img/badges/91x17-digg-button.gif"/></a>


Now, go back to your article and Edit it. Choose the “Edit HTML” mode and not “Compose” mode. Copy the above code and paste it into whichever part of your blog article. “Preview” it, and if you are happy with it, “Publish” it.

For this article, I have manually inserted the Digg button. If you would like to Digg this article, or just to see how it works, click this button. Add Digg button to Blogger or Blogspot

© Tips for New Bloggers

Found this article useful? Mention us in your post, subscribe to our feed, link to us, or bookmark this site. Thanks for your support!AddThis Social Bookmark Button

82 comments:

Deanna Moore said...

Another great tip! That makes 3 I've added to my site. Not sure how many people are gonna Digg a website about a baby but it's fun adding the blogger "hacks" anyway!

James
(Deanna's father)

BlogmasterPg said...

p data:post.body/ /p this line not in my template( i have blogspot.com, the new blogger)

bizwhiz said...

Hi blogmasterpg

Did you click Expand Widget Templates? If you have, it should be somewhere after the line "div class='post-header-line-1'"

webmaster said...
This post has been removed by a blog administrator.
SelahCounselingLLC said...

How much do I love that I found this site? HUGE. Appreciate the very detailed instructions! Thank you so much! Wendy

Nikesh Jauhari said...

Wow, Simple and great

Thanks
Nikesh

gamedaygeorge said...

Thanks! I added this to our blog if you're looking for a working example:

http://quickhitsblog.gamedayritual.com/2007/04/can-you-digg-it.html

Big Daddy Malcontent said...

I seem to be having the same problem as blogmasterpg.
Where is the "Expand Widgets Box?"

bizwhiz said...

Hello big daddy

When you are at "Edit HTML", you will see a little box at the top right hand corner next to where the chunk of code is. If you click it, you will see the expanded HTML code. When I could find time later, I might post a screen picture to show everyone where it is. Thanks for bringing this up. Should you have further difficulties with this, pl feel free to drop me a note.

Big Daddy Malcontent said...

Thanks, bizwhiz. I think I figgered it out. Perhaps you should note that your instructions are only applicable after bloggers have upgraded to the new custom templates. If you are still using the old blogspot template then the "expand widgets" thingy doesn't appear.

bizwhiz said...

Thanks for the info bigdaddy. I signed up under the new Blogger and never knew what the old one looks like. Cheers!

Miguel said...

Hi from Belgium!

Thanks 4 the tip, I was wondering for a long time how to do it. You just made my day!

shawn said...

Another great idea!!
Oh my, I wish I am as good as you...I've stumbled upon your blog and find it so helpful...everytime i have to look for tips i always run into ur site..thanks anyway...pls post how to maximize adsense...thanks..
read my blog at
www.cabaccishawn.blogspot.com

Candace Dempsey said...

I installed the Digg button at bottom of comments & it works great. This took me forever. However, I hate the way it looks, square and clunky. Making it smaller doesn't help.

I can't figure out how to install one of those little horizontal buttons. When I do, the functionality disappears and pressing it takes reader to a general Digg site.

Help! I am using classic template, so advice for the layout version just confuses me.

bizwhiz said...

Hi Candace

If you can see the square Digg button with the number of diggs, you should be able to install the other compact version which also has a digg count. These are the ones that Digg provides.

If you want one of the little horizontal buttons which do not show the digg count, you would have to separately create one for the individual post where you want people to digg your article. The code given is to be inserted into the article, and not the template.

Would you like to try it again or let me know which part of the writeup needs clarification?

Joe Wagner said...

Hey yeah... I am using an old template I guess and don't see an "expand widgets" button. Is there a way to paste this code into the post section of this old template?

Steve Pan said...

Thanks a lot! That's just what i need.

Alex said...

This is exactly what I was looking for! You're explanation and example were very clear. Thank you.

Lisa said...

I've been looking for this info all over. Thanks!

Badsra said...

Works beautifully! Thanks :)

malawika said...
This post has been removed by the author.
malawika said...
This post has been removed by the author.
malawika said...

Hi, thanks for it! At last I have this button in my blog :D

Now, you can DIGG it :)



I put a link to this post in my blog malawika - blog about blogging, making money online, SEO...

Andy said...

What if you have a blog controlled by FTP instead of Blogspot or a custom domain? I don't have access to the same edit HTML options (expand widget) as other blog setups, therefore no way to ever get to data:post.body.

Is there a way to add Digg to this setup?

bizwhiz said...

Hi Andy

We don't know much about FTP publishing since we have never used it. Aren't you able to login to your Blogger account via the normal way and view or edit your Template? If other readers have been using FTP, appreciate it if you could advise on how it can be done. Thanks.

Andy said...

I figured it out, somehow.

http://digg.com/submit?phase=2&url=URLofyourstory

It appears that if you don't host on Blogger, you have to use the classic template. That template does not have the Expand Widgets feature. I would also guess that the Blogger variables are different. For instance, when I inserted data:post.url in the above code, it wasn't pulling in the URL.

On a hunch, I tried this in the URL spot:

< $BlogItemPermalinkUrl$ >

and it now seems to work. (note: I'm not an expert and I haven't been to a Holiday Inn Express)

http://digg.com/submit?phase=2&url=<$BlogItemPermalinkUrl$>

I placed the code above < BlogItemCommentsEnabled >, in the < p class="post-footer" > section.

Maybe this will help others.

(www.clarionledger.com/blog :) )

Tomas Karkalas said...

Wow, I came to your blog so to say by an accident, but it was the most happy event. Your post will help me expand greatly my current knowledge that is just zero at a moment.
But what impress me the most is your willingness to help other/ sharing what you know with all who are want to know though a bit more than just to tape a word.
THANK YOU.

Mr. Woo said...

Great post; the pictures were useful.

Class Act said...

I had it working perfectly with the "Digg This Story" Button from http://digg.com/tools/buttons in classic Blogger, but now that I've switched to new Blogger I can't get it to work. How can I get the digg button to go not next to the post, but under it, in the footer? And preferably, with a different button than the big yellow once with the digg count? Thanks.

bizwhiz said...

Hi Class Act

We are using the new Blogger template and your answers have been addressed in this article. If there is any part of the article that you would like us to clarify, let us know.

Asil said...

bizwhiz,

It works, great! Thanks, man!

Class Act said...

Sorry, maybe I wasn't clear...your article does explain how to have the button appear at the end of your post, but I'm trying to have it appear at the end of the footer, right below the labels. That's where I was able to place buttons for ballhype, yardbarker, and stumbleupon, but I haven't been able to do so for digg like I did in the classic Blogger template.

bizwhiz said...

Hi Class Act

Check the "expand widget templates" box and look for this in the template:-

<p class='post-footer-line post-footer-line-2'>

The entire chunk ending with </p> is where the labels are. You can insert the Digg code right after this or before, depending on your preference.

Class Act said...

I'm sorry, I'm still not getting it. What code exactly am I supposed to paste in there? I pasted in the first code on your page and it just kind of screwed everything up, I guess because that was the code for putting it at the top of the post. If you go to my blog: http://between-thelines.blogspot.com/ you can see what I'm trying to do...I got the Digg button in there next to the other working buttons, but I can't get it to point to the right place.

Class Act said...

Which code do I paste? The code's on your site are for placing it at the top right or left or bottom of the post, so when I use those, it just screws things up. What code do I need to put a digg button (preferably the blue "DiggThisStory" button under my labels? Thanks.

bizwhiz said...

Hi Class Act

We have included a segment in the article for insertion of a Digg button in the Blog footer, after the labels. It should address your queries.

Class Act said...

Thank you that, was helpful, but one more thing please: is it possible to use one of these buttons here: http://digg.com/tools/buttons instead of the yellow button or the compact button? I'd really like this use the "DiggThisStory" blue rectangular box button with the thumbs up. If I could use one of those instead, it would be perfect. Thanks.

bizwhiz said...

Hi Class Act

Am I to confirm then that you do not want a real-time Digg count button? The other buttons do not show the count but are simply links to Digg. You may want to consider using an Addthis button for people to bookmark and submit your article to popular sites, including Digg.

netbobz said...

Hi there!

I'm a fan of your posts. Well, coming to the point, I would like to know how to put the Digg, Stumble and the Subscribe buttons in the same line after each posts. I might sound stupid as I don't have html knowledge! But it would be very nice of you, if you can write about this.

Thanks

Class Act said...

Yes, that's right bizwhiz, I don't want a count button. I just want a button that submits the given story to digg, placed under every individual post. I don't want it to show how many diggs it has received, so I just want one of those other buttons, particularly the blue one that says "DiggThisStory." How can I do that? Thanks.

bizwhiz said...

Hi Class Act

The article now covers the steps to insert a Digg button link as well, in addition to the automatic count button.

Class Act said...

Thanks so much, got it exactly like I wanted and it works perfectly. Thanks again.

Jake said...

I don't know the template code well, but I want to add the compact digg button below my title and to the left, but I don't want it to put the text next to it. I want a line break for the digg button. I am gonna try a few things out but if you reply soon enough, let me now :)

bizwhiz said...

Hi Jake

If you don't want any floating element like the digg button or adsense ads to the side of your blog post, locate this style and add the "clear" attribute:-

.post p {
clear:both;

Preview the blog and you should see the digg button above the post.

chaosgone said...

Thanks! That was easy.

Wesley said...

Thanks for the tip! I've used it on my blog now.

Coach Jeff said...

Every time I post the digg button code into my html editor and hit save it goes to an error 404 page and wont save the changes.

Ladybrille said...

Thanks so much for your great tips. I have been using some of your tricks. Check my blog out and let me know aht you think. Stumbled on the header/footer part under Rounders 2 making a 3 column. But will work till I become very techie savvy.

bizwhiz said...

Hi Coach Jeff

Which particular code are you using? Two usual causes I can think of whenever a template cannot be saved.

One, the code is not properly formed. It could be due to typo error, extra spacing in between certain characters, etc. You can block copy the code we provided instead of retyping it.

Two, the code is incorrectly inserted into the template. The position where the code should be inserted is crucial. For this article, we have listed several positions and tried them out, as seen in the pictures. Perhaps take a look at your template again and confirm that the code is at the right place.

Coach Jeff said...

Thanks for the reply. I got it to work this morning. Did nothing different than yesterday, bulk copied the code and pasted into the template in the same place. Maybe blogger was having difficulties yesterday. Any way thanks for the help.

Hutmacher said...

i cannot find the 'expand widgets' check box in my edit HTML, and (probably because of this) cannot find the data:post.body' text.

Has anyone else come across this?

I appreciate any help
- H

bizwhiz said...

Hi Hutmacher

If you are using the old classic template or any other third party template, it will not be the same. One way out may be to convert to the new blogger template. Note however that this will override any current margin, color and other setting you may have. On the other hand, with the new template, you will be able to use all the features that Blogger has.

Komail Noori said...

Really simple and really great.

Regards,
Komail Noori
Web Site Design - SEO Expert

Rachele said...

i am using the mr. moto template and the digg it button doesn't show up on the older posts page...is there a way to fix that? (you can see this on http://www.pdxpole.com)

Rachele said...

here is my html: (?=<>)
?div class='post-body entry-content'?
?div style='float:left; margin-right:10px;'?
?script type='text/javascript'?
digg_url = "?data:post.url/?";
?/script?
?script src='http://digg.com/tools/diggthis.js' type='text/javascript'/?
?/div?
?p??data:post.body/??/p?
?div style='clear: both;'/? ?!-- clear for photos floats --?
?/div?
?div class='post-footer'?

i am the one having difficulty making the digg this button show up on the older posts page.
thanks :)

Rachele said...

oops, nevermind, it looks like it was just google playing tricks on me and deciding not to show the button. it seems to have fixed itself :) thanks for all the great codes and hacks!

Geuro said...

I have the same question.
The digg button can't show up on the older posts page.

Is there a way to fix that.

Can you tell me,thank you.

bizwhiz said...

Hi Geuro

Which particular old post of yours is not showing the digg button? The way the code works, as long as that post has a unique post url, you should be able to see the button.

We just tested the code in our blog and went through several old posts and could see the count button. We have no immediate explanation for why you can't see it in yours.

bizwhiz said...

Hi Farvel Cargo

Usually, if you do not see the blog posts after adding the Digg code, it is because you have deleted this line:-

<p><data:post.body/></p>

Look at the code again and if it had been inadvertently deleted, put it back in and preview the template. You should see all the blog posts as well as the Digg button.

Selling online since 2003! said...

Thank you for getting back to me so fast! I got it back to the way is was and I think I will wait until I try that again!
You have a great blog!
Sue

ARUL JOSE said...

Hi, thanks for the tips. That was a great help to me.

When I click on the digg it link, it takes me to a page, where I click on the digg it link again to go to digg.com.

Is there a way to go straight to digg.com when I click on the digg it link?

ARUL JOSE R
http://tech-lense.blogspot.com

bizwhiz said...

Hi Arul Jose

Which code are you using? When you click the link, it should bring you to the Digg login page. But if you are already logged in, you should be able to Digg the article.

Don Lipper said...

Could you please show the code you are using for this post with the noncounter digg buton by the post title?
BTW, I also am having issues saving the template (using a block copy).
Thanks,
Don

Cynthia W Gentry said...

Any idea how to add the Digg counter graphic to your post AND have it track it to the Digg story you already submitted? I figured out how to add it to my individual post, but the counter shows 0 diggs for a post I've already Dugg (when I know there are at least 8).

I even figured out how to add it to that post only, but when you click on Digg It, it acts like you’re submitting a new post.

Thanks so much--this is a very helpful and clear post!

bizwhiz said...

Hi Don Lipper

We used the code shown in our article on Social Bookmarking Links. Among the social bookmark codes, there is one on Digg. Use that and insert it before the Blog Post.

bizwhiz said...

Hi Cynthia W Gentry

The auto submission is based on the title and URL of the post. When the article is submitted, Digg will check its database to see if similar articles have already been submitted and prompt the user to confirm.

To link to previously submitted story, take a look at http://digg.com/tools/integrate and under the custom submission section, they have provided a code that you can use.

100rabh™ said...

Good work...I never thought I will be able to do it

Matei Domnita said...

Nice one, thanks a lot.

indiessance said...

that worked great, but before this, I made multiple mistakes by visiting other misguided how to tutorials.

deKay said...

I was looking for how to do this today, and stumbled across your site. It didn't say exactly what I needed to do (I'm using an FTP-published old Blogger template), but you gave me enough info to get going, so thanks!

I've written up the changes I needed to make here:

http://lofi-gaming.org.uk/blog/2007/10/adding-digg-it-buttons-to-blogger.php

Katie said...

Thank you so much for your help :) I was ripping my hair out trying to figure out how to get this code working properly.

Cheers. You're my hero.

Joseph Patrick said...

Hey man, your site is great. I have looked a million times for where to put it, but I do not see it anywhere. What section do I post it under. You say 2/3 down the page, but I still don't see it. Thanks

JP
http://www.politidose.com/
josephpatrick@politidose.com

bizwhiz said...

Hi Joseph Patrick

If you are using the new Blogger template, you should see the codes after clicking the "expand widget template" option. If you are using the classic template, this guide will not apply and you may want to look elsewhere for the solution.

Eric Herboso said...

At the beginning of your post, where you say: "If you want the button to show at the top right corner of your post, replace the above code with...", you actually give code for the button to show up on the upper left corner of posts.

The code that follows should be modified to read "float:right;" as opposed to "float:left;", as it currently stands.

Just thought I'd point this slight error so others won't be too confused.

Eric.Herboso.com
EricHerboso.blogspot.com

bizwhiz said...

Thanks Eric. It has been amended.

rwcmick said...

Just wanted to say thanks! I was looking to add a Digg button to my blog and your post gave me all the options and answers that I was looking for. Very helpful!

rwcmick
All Cars, All the Time

M said...

I did what you said and now my right side bar appears below my posts! I can't fix it either. It looks horrible. Why would it make my sidebar move to the bottom?

bizwhiz said...

Hi M

There is no blog in your Profile for us to see where the problem might be. More likely than not it is a typo error or insertion at the wrong place. You may want to re-check that you have copied and inserted the code correctly. Preview the blog and save the template only when the button appears at the place you want and the layout is not affected.

Write-On said...

Thank you so much!! I have been trying over and over to add digg on my post without much luck. Thanks to you my readers can now digg my articles! Thanks so much! You rock!
On The wRite Side

Forest Parks said...

Thanks, that was easy!!

You have been RSS subscribed by me now.

Tanakwagu said...

i got this error message
* Provide the following error code and additional information.

bX-aigizw

try to implement it here
http://kaamatan.blogspot.com
i use new blogger version

bizwhiz said...

Hi Tanakwagu

Which of the codes in this article were you trying to insert when you had that error?