Thesis Tutorial: Adding the Facebook Like Button to Individual Posts for Dummies


If you enjoyed this post, be sure to sign up to my list to receive exclusive information I don't share publicly about making money via affiliate marketing and SEO.



  1. Meg Geddes says:

    This is great – and this post was actually the first one I tested after Facebook made the changes. I particularly like the fact that you can now specify the image you want associated with the post (with various services I would have ad images show up in my FB shares if I didn’t turn off thumbnails entirely)

    So you’ve got this, and your tutorial on adding the official Tweet button with Thesis hooks; what else do we really need as far as social media buttons?

    BTW, for what it’s worth, I’ve been testing Facebook Like Boxes; as much as I really don’t like the one that displays the faces, I can’t argue with the results. The ‘likes’ jumped through the roof everywhere I added it.

  2. Hi Rae,
    Great tutorial, looks great. One issue – and I’m having it with all the various FB & twitter buttons on Thesis – how do you make the buttons which show on the homepage (on excerpts) share the post they are attached too and not just the homepage url.

    Here’s an example of where this is happening –

    I can get the sharing buttons to work fine on teasers, but not excerpts, can’t find anything over the the thesis forums either, so was hoping you’d know.

    Thanks :)

  3. Actually the link I gave has now switched them off on the HP..

  4. Rae Hoffman-Dolan says:

    Sorry, not real sure of the question without being able to see an example. That said, I also don’t show buttons on my homepage, so I wouldn’t know without spending time to check it out, figure out how it works and write a custom hook which I wish I could do for everyone who wants to do something more than what I’ve shared, but I can’t. If anyone else knows though, they’re welcome to post the code.

  5. Thank you so much for the very clear step by step instructions. I was at a loss as to how to get it to work till I came on your site :)

  6. Oh p/s while the coding worked like a charm, it played havoc with my stats. I had a sudden influx of entries from facebook and additional code was being appended to my url so nothing shows. I’ve tried reverting to the old iframe code but the problem persists. Guess I might have to remove the Facebook Like button for now.

  7. Definitely one of the better “Like” button tutorials I’ve seen around. Just tested that plugin using a slightly modified version of this method on a different theme and it’s worked a charm. Thanks for sharing!

  8. Rae, thanks for the post. It’s clearly written but for some reason, the Like button isn’t appearing on my site. I don’t expect you to troubleshoot but am curious to know if you have any thoughts about what might prevent the button from appearing. I have quadruple checked the custom function and of course followed the process of registering with FB. Still, nada…

  9. Rae Hoffman-Dolan says:

    For the record, I did end up taking a quick look at Wesley’s problem via email and the issue was that the single quotes contained a formatting that was messing with the programming. If the code looks exactly right yet it doesn’t work? Always ensure that all double ” and single ‘ quotes don’t contain any accidental formatting. To do this, delete and replace them directly in the custom functions file. #annoyingbuttrue

  10. Thanks for the post, Rae. I messed with several Facebook “like” plugins, and found this solution to be the best for those of us using Thesis.

    I noticed a few days later in Google Analytics that the URLs of my posts that had been liked were showing up a second time, with a “?fb_xd_fragment=…” query string tacked onto the end. This is a known issue with XFBML implementation of the FB “like” button. I went into GA and Google Webmaster tools to keep the 2nd URLs from being tracked and indexed (to avoid duplicate content).

    The issue and solution are described at Hope this helps someone!

  11. Jared Randall says:

    First off Rae, thanks for the detailed instructions…
    @Brian, the link you gave out to fix the Facebook “like” fragment in Google analytics isn’t working anymore? I’m trying to fix this problem myself and can’t find a good resource?

  12. Thank you for doing this! I’m an absolute idiot with hooks, so hopefully this will work. I just upgraded to thesis 2 and it’s like learning all over again, so I’m crossing my fingers.

Leave a Reply

Your email address will not be published. Required fields are marked *