Adding ‘send to del.icio.us’ links to WordPress posts
del.icio.us is one of a new generation of community sites that handle your links, posts and articles in interesting ways. Del.icio.us prides itself on being the most popular social bookmarking website allowing users to keep their favourite links or bookmarks online, rather than on their PCs. Nothing too remarkable about that you may say but the clever bit comes when they combine this information to use it in other ways. Then you can see if other people have similar links to you, just how popular your bookmarks are and you may find some links that are more useful than your current ones.
Today I decided to add the ‘send to del.icio.us’ links to the bottom of my posts to allow people to automatically add them to the network. This should have been easy as the del.icio.us Save Buttons page has some code there I could use specifically for the the WordPress files which run this website. Unfortunately it didn’t work.
<a href="http://del.icio.us/post" onclick="window.open('http://del.icio.us/post?v=4&noui&jump=close&url=<?php the_permalink() ?>&title=< ?php the_title() ?>','delicious', 'toolbar=no,width=700,height=400'); return false;">Save to del.icio.us</a>
The reasons the original code wasn’t working were the encodeURIComponent functions in combination with the apostrophes. I removed them, as they’re both url encoded anyway, and it seems to have worked. So if you come across this page from a search engine or one of the other new social/community/network sites then please save it to del.icio.us as this could help some more people out.