Jump to content

Beldonga

Members
  • Posts

    1
  • Joined

  • Last visited

Beldonga's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Hi, Tumblr's current 'Share on Tumblr' button http://www.tumblr.com/buttons is made to share PAGES, not posts. I want visitors of my wordpress blog to be able to share pictures. Tumblr is, after all, a picture blog. A post to tumblr should therefor be a picture post, using a posts 'Feature image' as the picture. This post should include the source, title, click-through, and the text from within the post (the later will only be visible on tumblr if you choose to view the whole post). Anyone out there skilled enough to modify this? A friend of mine told me to put the ID Number from the object in html elements ID-field. But I have no idea what that means, or how to do it. Following is the code I use so far. It does what I want, but the click-through and title does not work. <!--Add this code to your page right before the </body> tag. -->(I've been putting this in the index.php after the </body> tag).<script src="http://platform.tumblr.com/v1/share.js"></script> <!-- Put this tag wherever you want your button to appear -->(I've been putting this inside the posts).<span id="tumblr_button_abc123"></span> <!-- Set these variables wherever convenient -->(I've been putting this inside the posts).<script type="text/javascript"> var tumblr_photo_source = "The 'Feature Image'"; var tumblr_photo_caption = "The post title"; var tumblr_photo_click_thru = "The post URL";</script> <!-- Put this code at the bottom of your page -->(I've been putting this inside the posts)<script type="text/javascript"> var tumblr_button = document.createElement("a"); tumblr_button.setAttribute("href", "http://www.tumblr.com/share/photo?source=" + encodeURIComponent(tumblr_photo_source) + "&caption=" + encodeURIComponent(tumblr_photo_caption) + "&clickthru=" + encodeURIComponent(tumblr_photo_click_thru)); tumblr_button.setAttribute("title", "Share on Tumblr"); tumblr_button.setAttribute("style", "display:inline-block; text-indent:-9999px; overflow:hidden; width:129px; height:20px; background:url('http://platform.tumblr.com/v1/share_3.png') top left no-repeat transparent;"); tumblr_button.innerHTML = "Share on Tumblr"; document.getElementById("tumblr_button_abc123").appendChild(tumblr_button);</script>
×
×
  • Create New...