WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
Can't you just edit loop.php? Am I missing something? – Wordpressor Nov 23 '11 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. – Jonathan Wold Nov 23 '11 at 3:55
up vote 1 down vote accepted

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. :)


share|improve this answer
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. – Jonathan Wold Nov 23 '11 at 14:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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