Adding del.icio.us Link Tags to Blog Posts

I’ve seen this how this can be accomplished in several places on the ‘net but I have to give the most credit to Fresh Blog for the idea and an example of how this can work. The idea is to create a handy link for your readers that can be used to open a new window on your blog and tag the post to their del.icio.us favorites and it will automatically fill in both the page link AND the title of the post with one click. Of course the reader will have to already have or they will have to create a del.icio.us account to use the tag.

If you don’t have a del.icio.us account, you should, I can’t stress enough how cool this service is and how much web traffic that you can generate by tagging your own posts to your favorites, and it allows visitors to easily tag you to their favorites and have other people find your site by following the links that they have posted and so on and so on…

First up I’m going to give you the code to do it in a Blogger post, this is nothing new really, you can find this code at other sites including over at Fresh Blog but I’m also going to give you a very simple modification of it to use in Wordpress.

First up is Blogger, but make sure you backup your template before doing this, I’m not responsible for mistakes you make editing your template. You can copy and paste the entire template into a .txt document, then paste it all back in if you mess up. To learn how to properly backup HTML documents, please check out my tutorial right here…

Just select all then copy and paste the following code into your template just after the word “comments” in the “post” division. You may have to experiment with the placement in the template depending on where you want it to appear, either before the “Comments” link or after and if you’re using Haloscan commenting you may have to experiment with the placement even more. Of course you can paste the line in and use “Preview” to see where it will show up, if you don’t like the placement just cut and paste it into different spots till you get it just right.

For Blogger

If you don’t want an image on the link like I have below this tutorial, just back space thru the “img src” section right after “Tag This Post” in the code.

Ok, now for the very simplified Wordpress version. No plugins needed and no you don’t even need PHP to execute the link, it’s simplay a variation on the Blogger setup and if you inspect how it works I’m sure it can be easily modified to work with many other platforms.

Just like the Blogger folks, you really, really should make a backup copy of the post.php sheet or whichever sheet you’re going to be editing! I can’t be responsible for your mistakes!

To get started, go into your theme editor and go to your post.php page and look at the “postmetadata” section. In there you will see the word “comments” listed several times in a row, if it’s not in that sheet it may be in the index.php sheet or Main sheet. You want to place the code just past that line and you may want to use a | with a space on either side to separate it like I did below on this page. You can play with the spacing to make it look nice and even.

In some Wordpress templates you may need to place the link in the Main or Index PHP sheet as I had to do on an earlier version of Wordpress (version 1.5.1.2) that didn’t have a separate sheet for the “post”. I’ve also tested it on the very latest version which I am running here at the moment (version 2.0.2)

For Wordpress

If you don’t want an image on the link like I have below this tutorial, just back space thru the “img src” section right after “Tag This Post” in the code.

In both the Blogger version and the Wordpress version the links will open a new window to del.icio.us, very cool! If you have any problems or feedback with using this setup, please dump it into the comments below, I’ll help as much as I can!

If you liked this tutorial I would appreciate you tagging it to your del.icio.us favorites using my link! Thanks!

tags: , , , , , , , ,

One Response to “Adding del.icio.us Link Tags to Blog Posts”

  1. Serena (Blogscapes Artist) Says:

    Hi,

    I’m pretty new to the blogging details so your posts have been pretty helpful, though I must say that the more technical bits still elude me such as RSS and tags. Hope to get a hang of them soon!

    cheers

Leave a Reply