The example provided by StumbleUpon edits the Single.php of a typical Wordpress theme. The button will only appear under the entry after the reader has click the entry title to go into single.php.

Why not have the StumbleUpon button on the main index page of Wordpress? To do so, go to Theme Editor to edit Main Index Template (Please backup the Main Index Template which is index.php before you proceed):

themeeditor.jpg

Add the following HTML block after the Comments codes:

<a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>"><img src="http://www.yoursite.com/images/stumbleit.gif"> Stumble it!</a>

addhtml.jpg


Do change the path to the GIF button file accordingly instead of http://www.yoursite.com/images/stumbleit.gif before saving.

You should have stumble button at your main index page!

Like this entry? Share it with others! : These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Technorati
  • StumbleUpon
  • del.icio.us
  • Slashdot





    3 Responses to “Adding Stumble button to index.php”

    1. Ash Nallawalla says:

      Appreciate the tip!

    2. Jym says:

      :)

    3. Daniel says:

      Hopefully we can do it right. Thanks for the tip!

    Leave a Reply