Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

General Discussion

Multiple Facebook Like Buttons on one page

Hello,

I was wondering if anyone knew how to incorporate multiple facebook 'Like' buttons on one page? As currently it only allows you to like the page which you are on, which isn't ideal for multiple elements that need liking?

Can anyone please help?

Thanks,

Joe

3 Answers

You're going to struggle I believe. I'm guessing you want a like button on an archive page or something? Thing is, think about how the computer "likes" something. On an archive page, there's still only one url for the "like" to like.

Yeah that's exactly my problem!

You can do this with addthis here is the help article that covers it.

Looking on Facebook's developer site there seem to be url options for "Like" buttons so I would imagine you use their own code as well.

With either option you should be able to repeat the button, setting a different url for each occurrence.

Great thanks Tom, I'll check this out!