Herself's Webtools

Scripts, HowTos, Templates, Plugins, Widgets, Tips

How to add ‘StumbleUpon’ links to your blog posts

First backup your template.

Go to Layout->Edit HTML and click download full template.


<a expr:href='”http://www.stumbleupon.com/submit?” + “url=” + data:post.url + “&amp;title=” + data:post.title’ target=’_blank’> Stumble it!</a>

For Blogger go to your Template->Edit HTML and click expand widgets.
Find <p class=’post-footer-line post-footer-line-3’/>

It’s about three quarters of the way down in most templates.

Then just add the above code just below that line.


<a href=”http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>”> Stumble it!</a>

James Wilkes Design sent me a corrected version of this link ( see comments below: )

<a href=”http://www.stumbleupon.com/submit?url=<?php echo urlencode(get_permalink(get_the_ID())); ?>&title=<?php echo urlencode(get_the_title(get_the_ID())); ?>”>Stumble it!</a>

You will want to edit your template to add the link.

Go to Presentation->Theme Editor

Select Main Index Template, or index.php or what ever the index page is called in your template.

Find the section that has the postmetadata add the above code in there somewhere that looks nice on your template.

See also:
How to add Digg Links to Blogger and WordPress Posts
How to add Del.icio.us Links to Blogger and WordPress Posts
How to add Reddit Links to Blogger and WordPress Posts