Social bookmarking sites can bring you a huge traffic, but being featured on popular sites as such as Delicious.com isn’t easy. To achieve this goal, here is something to help you: A “Save to Delicious” button.
Social bookmarking sites can bring you a huge traffic, but being featured on popular sites as such as Delicious.com isn’t easy. To achieve this goal, here is something to help you: A “Save to Delicious” button.
This recipe is very easy to achieve: Paste the following code within the loop, on your single.php file.
<a href="http://del.icio.us/post?url=<?php the_permalink();?>">Save this link to Delicious</a>
14 Responses
Well, I always though it involved something more complicated than this. That’s why I like this site, noting is too simple to share.
Thanks my friend! You’re right, nothing is too simple to be shared as long as it is useful
Isn’t this just a text link and not a button?
@Chris Berry: Yes, it is a text link, sorry for that mistake! Anyways you should easily display a button instead.
If you want to automatically fill out title and notes you could use the following:
http://delicious.com/save?jump=yes&url=&title=¬es=
Though, I haven’t found out how to fill out the tags yet.
Well, WP comment form stripped out the PHP, but you figure out where the_permalink(), the_title() and the_excerpt() go
Thank you Ronny for this useful addition to my post!
How do i add to a non blog site?
For the sake of correctness, shouldn’t you escape the permalink? Theoretically it shouldn’t contain an ‘&’ symbol but what if it does in some corner case?
You really should urlencode the link – otherwise there could be problems with it. here is how i do stuff like this:
function delicious_link(){
global $post;
$link = get_permalink($post->ID);
$url = ‘http://del.icio.us/post?url=’.urlencode($link).’&title=’.urlencode($post->post_title);
return $url;
}
// example call
// <a href="” title=”">bookmark on delicious.com
Good to Know This. I will use it in my blog.
Trackbacks: