Social Bookmarking Widget

After a couple hours of hacking with JavaScript, I finally created my very first SEO-friendly social bookmarking widget specially for this blog. As you can see, I’ve positioned the bookmark widget right at the top of the post to get the most attention and clicks.

Social Bookmarking Widget

The widget is constructed with JavaScript. It is a very simple script which I modified from Build Your Own Social Bookmark Widget by Gath Adams.

// JavaScript - bookmarking_widget.js
var theTitle = encodeURIComponent(document.title)
var theURL = encodeURIComponent(document.location)
document.write('<style type="text/css">
  .bookmark_widget{margin:15px 0 10px;font-size:12px;
  font-family:arial,verdana,san serif}
  .bookmark_widget a{font-weight:normal;margin-left:5px}
document.write('<div class="bookmark_widget">')
document.write('<a href="'
  title="See who bookmarked at" >
  <img src="
  delicious.gif" alt=" " height="16" width="16"
  border="0" />&nbsp;</a> ')
document.write('<a href="
  faves/?add='+theURL+'" title="Favorite it at
  Technorati" >
  <img src="
  images/buttons/fave.png" alt=" " height="13"
  width="18" border="0" />&nbsp;fave it</a> ')
document.write('<a href="'
  +theURL+'&title='+theTitle+'") title="Add To
  Reddit"><img src="
  reddithead4.gif" alt="Reddit" height="16" width="16"
  border="0" />&nbsp;reddit</a>')
document.write('<a href="'+theURL+
  '&title='+theTitle+'") title="StumbleUpon - I like
  it"><img src="
  images/icon_su.gif" alt=" " height="16" width="16"
  border="0" />&nbsp;StumbleUpon</a>')

And I modified the file single.php of the Prologue theme.

<div id="widget_digg">
  <script type="text/javascript"
<script type="text/javascript"
  src="<?php bloginfo('template_url'); ?>
<?php the_content( __( '[More...]' ) ); ?>

From the source codes above, you can see that I placed the bookmarking widget after the Digg It Submit Button. I think this layout looks pretty neat.

Beside adding the social bookmarking widget at this blog, I also installed it at and As I have a wider column in both of these blogs, I was able to squeeze in a few more social bookmarking site: Furl, Reddit and also friendfeed.

Social bookmarking widget plus

“But I don’t know JavaScript”

If you are not familiar with JavaScript or just don’t like to DIY, then you can try using Share This WordPress Plugin instead.

Leave a Comment