How do I integrate StumbleUpon links within WordPress?

I was asked earlier today at the Blog Or Not To Blog blog (that’s a mouthful!), how I added a StumbleUpon button to each of my posts on cymru66. It’s fairly easy and it saved me the trouble of installing a WordPress plugin. Not sure which option gives the best end result, but I’m happy with my solution and it seems to work.

The end result will add a StumbleUpon button like this one at the bottom of your post:

StumbleUpon

Here’s how to do it:

  • Edit “single.php” of your WordPress theme. Log in as an admin to your blog, click the “Presentation” tab and then the “Theme Editor” tab.
  • Click the “Single Post” link on the right side of the page. Make sure you are editing the correct theme at this stage.
  • Find the following line of code (or similar line, depending on your theme file) in “single.php”

    <?php the_content(’<p class=”serif”>Read the rest of this entry »</p>’); ?>

  • Immediately after this line, add the following code:

    <a href=”http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&amp;title=&lt;?php the_title(); ?&gt;”&gt;&lt;img src=”http://www.stumbleupon.com/images/small_su_logo2.png”&gt; Stumble it!</a>

  • Click the “Update File” button and you should be all set!

The above instructions will only work if your files are writable within the WordPress admin panel. You may need to download the “single.php” file to your computer, make the changes as described above before uploading back to your theme folder.

Now, with any luck, every post on your blog will contain a StumbleUpon button which, if you click on it, takes you to a review page within the StumbleUpon web site.

Hope that helped. Please leave a comment if I totally confused you. I’m no WordPress expert and not the best at writing a techie tutorial either! If you enjoyed this post, please consider Stumbling it!

Technorati Tags: , ,

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

 

Related Posts:
  • Quick update to my Wordpress theme
  • Rewarding Readers with the WordPress DoFollow Plugin
  • WordPress Theme Generator
  •  

    5 Responses to “How do I integrate StumbleUpon links within WordPress?”

    1. JuliaxXx Says:

      First i stumbled you right away! second I DIG THIS tutorial !!!!!!! ill do it my self too on other blog :) or might be even on my main one bontb :)

    2. Sandra Says:

      Great article, I will stumble it so others can learn from it too!

    3. Promote your website - blog advertising Says:

      […] forget to use stumbleupon button by  cymru66 this will bring you a lot of […]

    4. Link Love (5) | Make Money Online Says:

      […] wrote an explanation about how you can integrate a StumbleUpon button into your posts, without using any […]

    5. Drew Jones Says:

      For multiple social bookmarking services all at once, check out http://onlywire.com.

      Then for inpost links. check out this, http://www.text-link-ads.com/.

    Leave a Reply