How to make a 'like' button for each post without going on permalink page? I mean, even in the homepage, which script can I use to have something like the heart on this page? (mouseover the photos, there's a heart to like the post)
相关问题
- Scroll bar not appearing?
- Is it possible to load tumblr posts via AJAX?
- Styling tumblr reblog comments
- Change style of most recent Tumblr post
- How to get first image from a tumlbr rss feed in P
相关文章
- Posting an image to the Tumblr API
- Filtering posts by tag on Tumblr page?
- How to add a tag cloud on Tumblr?
- add content every 3 posts on Tumblr
- First image only from photoset on indexpage, then
- Android Tumblr Oauth-signpost 401
- get oauth token with tumblrs official php client
- How to access Tumblr API Photo Data Feed (i.e. all
I've created a tutorial on this at: http://like-button.tumblr.com. It eliminates the problems people have with implementing this and makes it a simple cut and paste.
To add Like functionality, you use the following URL and set it as the
src
attribute of an invisible<iframe>
:<command>
:like
orunlike
<oauthId>
: last eight characters of{ReblogURL}
<postId>
:{PostID}
Example:
Cut and paste the following code block into your theme immediately before
</head>
. This will give you a Like button on each post that looks like the default Tumblr grey heart. It will turn red when you hover over it and when you click it. If you click it again, it will turn grey again and delete the Like.Code:
Then cut and paste the following button code into your theme where you want your like button to be (this must be inside your
{block:Posts}
block).Code:
From the page, they're using the javascript:
So
post
is just the HTML element of the post, they then simply get theid
of that post and the 8 char code needed to like or reblog a post. They take all this, throw it into a URL and set it to the source of an iFrame on the page (#likeit
)