Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 25, 2012, 06:06:11 AM

Pages: [1]   Go Down
  Print  
Author Topic: Fixing Digg button to wrapper  (Read 690 times)
indianheadnation
Space Explorer
***
Offline Offline

Posts: 9


« on: October 18, 2010, 01:30:51 AM »

I've been trying to get this to work on my site, but I'm not exactly sure the right way to go about writing the code to accomplish it. I basically know what I need to do, but I need a little bit of help to get it right.

Basically, what I'd like to do is attach the "Digg" button to each post in WordPress... which would require me to edit the single.php (Single Post) file.

The easy way to do this would to just attach the code to each post, which is this:

<script type="text/javascript">digg_url = "<?php the_permalink(); ?>"</script>
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script>

That would be fine and all but now I need to position it. What I want to do is basically have it attached to the wrapper (or I should say fixed) on the left side of the wrapper, so that when the user scrolls, the button scrolls with the page as well.

Now I figured I might use a code like this:

<div style=”display:block;float:left;top:0px;position:fixed;left:40px;”> (DIGG BUTTON SCRIPT GOES HERE) </div>

But I ran into a problem, obviously the users page width will effect the positioning on that and the button won't really be attached to the wrapper.

So, my obvious question is, how do I fix this button to the wrapper of each post?
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: