Question

I am using the following code to add Facebook Like button to my website :-

<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2FXXXXXXXXXX%2FXXXXX%2FXXXXX.php%3Fid%3D<?php //echo $row['my_id'];  ?>&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21&amp;appId=104780909636116" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:100px; height:21px; float:left; margin-top:14px;" allowTransparency="true"></iframe>

But after clicking the like button and when i look into my FB wall all i can see is some other image as well as other content from the same page, but not the one which i meant to like. Can anyone suggest me a solution for this? I am looking forward for some valuable suggestions.

Was it helpful?

Solution

Page specified in href attribute of Like Button should be publicly available and have OpenGraph meta tags including og:url which should be canonical URL pointing to page that represent "liked" content, if this isn't the same page, than one specified by og:url should have OpenGraph meta tags with content that will be published on user's feed.

You can ensure that correct data crawled by Facebook by passing URL of liked page to Debug tool

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top