0

I have an index of posts where I'm wanting to insert a Facebook Like button for each post. Thus far, I've set all Open Graph data in the head for single posts. Any ideas on using the open graph data (particularly, the thumbnail) within the loop?

2
  • Can't you just edit loop.php? Am I missing something? Nov 23, 2011 at 2:19
  • Yes, the challenge is that open graph, as I've seen it thus far, is intended as a single instance on a page, rather than an instance, as I'm wanting, for each of the items in my loop. Imagine, if you will, 10 sets of open graph data. Nov 23, 2011 at 3:55

1 Answer 1

1

Short answer: you can't do that, that's not what OpenGraph data is, does, or how it works.

Long answer: OpenGraph applies to the single post pages only, realistically. When you're putting a like button (for example) onto each post on a archive page, the like button is going to point to the permalink of the single post. That's where FB will look for the OG data for that particular like, not on the archive/home page.

Best answer: Don't DIY it. Just install my Simple Facebook Connect plugin, and let it do all the OpenGraph grunt work for you automagically. I just added support for Audio data, and I'm improving the video handling now. SFC 1.2 will have some great functionality there. :)

http://wordpress.org/extend/plugins/simple-facebook-connect/

1
  • Otto, that makes sense. I didn't think about it hitting the actual link to grab the OG data. I will take a look at the plugin! I try to avoid plugins where possible, but this may be an exception. Nov 23, 2011 at 14:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.