Custom Search

Monday, February 2, 2009

How to put a DIGG widget or button on every post

Sponsored Links

Step by step tutorial on how to put a DIGG widget or button on every post.

This step by step tutorial will tell how to put a DIGG widget or button on every post. Just like what I did on this blog (see DIGG button on the right side).

1. Login to your Blogger account.

2. Backup you Template.

3. Check the Expand Widget Templates checkbox.

4. Locate the code <p><data:post.body/></p>.

5. Just before the code above, copy and paste the code below.
<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>

6. Click SAVE TEMPLATE and view your blog.

11 comments:

The Trading Investor said...

Thanks for the step by step instructions! Definitely the easiest way so far than what I have searched from the net.

The Trading Investor said...

I tried your tutorial but I could not find the code: <p><data:post.body/></p>

I hope you could help me on this. thanks!

EditorPinoy said...

Try to locate this code:

data:post.body/

Hope this helps.

Carolla Radio Blog said...

Hi. I've got the code installed in the right place but when I click the Digg button (from our blog's front page), it submits the whole site to Digg, not the individual entry. Is there a way to fix this?

EditorPinoy said...

Hi there Carolla,

Replace the code:

digg_url=&quot;<data:post.url/>&quot;;

with this one:

digg_url = &#39;<data:post.url/>&#39;;

That should fix the problem. Would you please tell me it really fixed your problem so that I could update my post? It seems like I have pasted the unparsed code. Thanks! =)

Carolla Radio Blog said...

Looks like it's still not working. :( When I hover my cursor over the Digg icon, the link in the status bar says "...&title=Carolla+Radio+Blog" at the end, instead of the entry's title. Also, I'm not sure if this would affect anything but we're using a custom template.

http://carollaradioblog.blogspot.com/

EditorPinoy said...

Hi Carolla,

I just checked your site. You can see it working on my other blog, CLICK HERE.

Actually the code above is from www.digg.com. Hence the line:
http://digg.com/tools/diggthis.js

I suspect that the cause may be your custom template, as you have said.

Try searching for the line below:
data:post.url

That is the variable which holds the complete URL of your post.

If you have any questions please don't hesitate to ask.
I will try to help you with all my powers.hehe

Carolla Radio Blog said...

Thanks. I just "dugg" a post using my own Digg account and it does Digg the individual entry, you just have to change the title of the article and put your own summary in. A minor annoyance, but I suppose it will work for the time being.

I noticed on your blog that at the bottom of the entries, there's a smaller Digg button. I clicked on one of those and it seems to be Digging the entry, not your site. How could I go about getting this to work?

EditorPinoy said...

Copy the Code below and paste it after <data:post.body/>:

<a class='timestamp-link' expr:href='&quot;http://www.digg.com/submit?url=&quot; + data:post.url + &quot;&amp;title=&quot; + data:post.title'><img alt='digg 16x16 button' border='0' src='http://i426.photobucket.com/albums/pp341/PinoyINGermany/digg.gif'/></a>

NOTE: It would be best that you use your own image and replace the http://i426.photobucket.com/albums/pp341/PinoyINGermany/digg.gif
this way you can use your own digg image.

Grant Hammond said...

I do not have this exact code in my HTML

EditorPinoy said...

Maybe you are using a custom blogger template.

Post a Comment

Please subscribe to my rssfeed 16x16 button Subscribe to my RSS Feed or email subscription 16x16 button Subscribe via Email if you want to receive updates. Thanks! ^_^