Help - Search - Members - Calendar
Full Version: Like Button for Tumblr
Forums > Resource Center > Webmasters' Corner
fiveseven
Saw a good example of this at http://cicerontheme.tumblr.com/. You can like a post from the homepage without having to go to the permalink page.

Here's what I've found from her source.

CODE
$(document).ready(function(){
    $('a.like_link').click(function() {
        var post = $(this).closest('.post');
        var id = post.attr('id');
        var oath = post.attr('rel').slice(-8);
        var like = 'http://www.tumblr.com/like/'+oath+'?id='+id;
        $('#likeit').attr('src', like);
        $(this).addClass('liked');
        return false;
    })
});


CODE
<a href="{Permalink}" class="like-link">Like</a>


I tried to recreate this button here: http://mockuptheme.tumblr.com

I click 'like' but it doesn't show up in my likes page.

What am I doing wrong?
fiveseven
I'm gonna go get some Chipotle and I expect this to be answered by the time I get back.
none345678
Hopefully it takes you 3 weeks to get Chipotle.
fiveseven
So I got chips and usually order two sides of guacamole cause the chips are too many, but what the f*ck is this - fewer chips and too much guacamole!
fiveseven
yeah thats where i found it actually, but it didnt explain much past the js part.
fiveseven
ay, ay! ??????
fiveseven
21 DAYS, C'MON
fiveseven
2 months.
tokyo-rose
QUOTE(doodoo @ Nov 10 2011, 01:08 PM) *
2 months.

No one who's good with Tumblr coding is around anymore, so :\
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.