سؤال

I'm working on the site I Am Stronger. On the blog pages, I have 2 different like buttons, one at the top and one for the actual blog post.

I would like the blog posts to show their own "like" total. I have their URLs to be different on each, but for some reason the number passes from one to the other. For example, I liked this story but this story also says I liked it. Their iframe codes are different, with the first pointing towards the first unique story (story 12) and the second pointing towards the second story (story 14). The URL's are encoded, but look like this respectively:

<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fhttp%3A%2F%2Fiamstronger.ca%2Findex.php%3Fpage%3DActivityDetail%26story%3D12&amp;send=false&amp;layout=button_count&amp;width=100&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=segoe+ui&amp;height=21"></iframe>

<iframe src="//www.facebook.com/plugins/like.php?href=http%3A%2F%2Fhttp%3A%2F%2Fiamstronger.ca%2Findex.php%3Fpage%3DActivityDetail%26story%3D14&amp;send=false&amp;layout=button_count&amp;width=100&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=segoe+ui&amp;height=21"></iframe>

Can somebody tell me what this issue could be?

Thank you.

هل كانت مفيدة؟

المحلول 2

My browser was cacheing it. It was working all along. I feel really stupid now. Sorry >.<

نصائح أخرى

This is your code in the first link:

<div class="fb-like fb_edge_widget_with_comment fb_iframe_widget" style="float: left;     margin-bottom: 5px;" data-show-faces="false" data-width="80" data-layout="button_count" data-send="false" data-href="http://iamstronger.ca/" fb-xfbml-state="rendered">

And this in the second link:

<div class="fb-like fb_edge_widget_with_comment fb_iframe_widget" style="float: left; margin-bottom: 5px;" data-show-faces="false" data-width="80" data-layout="button_count" data-send="false" data-href="http://iamstronger.ca/" fb-xfbml-state="rendered">

I believe the problem is that they both point to the same url. Also checked on Facebook developers (http://developers.facebook.com/docs/reference/plugins/like/) and the code could be something like:

<fb:like href="http://iamstronger.ca/index.php?page=ActivityDetail&amp;story=12" send="false" width="450" show_faces="false"></fb:like>

So the "story=xx" would need to be different for every different blog entry, you would need a way for that to be automatically given (ie not hardcoded)...

Just my 5c :)

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top