Add StumbleUpon to WordPress Blog
StumbleUpon News announced that now we can integrate StumbleUpon with our blogs. It allows visitors directly submit your posts to StumbleUpon(SU).
Here is the tutorial for adding StumbleUpon link to WordPress.
StumbleUpon integration code for WordPress
By referring to the SU integration code, here is the SU integration code for WordPress blogs:
<a href=”http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>”><img src=”http://www.stumbleupon.com/images/stumbleit.gif“/> Stumble it!</a>
The code will create something like this: Stumble it!
Hint: Feel free to change the icon by replacing the filename(stumbleit.gif) with other StumbleUpon icons.
Install StumbleUpon code for WordPress
- Edit “single.php” of your WordPress theme
- Find the following line(or similar, depends on your theme file) in “single.php”
<?php the_content(‘<p class=”serif”>Read the rest of this entry »</p>’); ?>
- Immediate after the line, add the SU integration code for WordPress.
- Now, your code should look like this:
<?php the_content(‘<p class=”serif”>Read the rest of this entry »</p>’); ?>
<a href=”http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>”><img src=”http://www.stumbleupon.com/images/stumbleit.gif”/> Stumble it!</a>
- Save and upload “single.php” back to your WordPress theme folder. Done!
My two cents
I hope you like this little WordPress hack. Why not a plugin? Well, I do not create another WordPress plugin for a simple link.
If you have difficulty to implement this, feel free to Contact Me. :)
By the way, this is My StumbleUpon Page. Please add me as your SU friend. :)