I have a loop where all the posts have their own like button, when i click it the facebook window appears but it does not show the right post thumbnail.
I think this is normal because in a posts loop the thumbnails are multiple so the script can not figure which one goes where – on the contrary the like button works perfectly on my single post pages.
So my question: is it possible to have the facebook like button work correctly on a loop page so that it grabs the right post thumbnail even if there are, say 10 posts in that page?
Maybe i should have multiple Open Graph metas, a set for each post in the loop, but i guess this would just cause a mess, is there something that i can do?
As far as I know this is not possible the way you’re trying to get it to work. You can specify an image for Facebook to use in the
<meta>
tag, but that’s about it.One thing you can try is use JavaScript to invoke the Facebook feed dialog. It has a
picture
parameter:The Javascript Example section at the link above is pretty self-explanatory.