问题
I'm using this code to implement the like button
<fb:like layout="button_count" show_faces="false" width="450"></fb:like>
But when I try to click it the counter is increased for about 1 second and then it goes back to zero again. I can't see on my facebook profile that i've liked something either. Someone have a solution for this?
回答1:
As other have mentioned some of your open graph meta tags may be missing or incorrect. You can valid your page with the Facebook URL Linter: https://developers.facebook.com/tools/lint/
Pretty handy tool and should help you find out what's causing the problem.
回答2:
I ran into this problem once. If you use Firebug to inspect the request/response you'll probably see that Facebook is returning an error to you.
In my case, I hadn't set up the proper permissions on the Facebook "connect" settings to allow 'like' requests from my domain name.
回答3:
You need to specify a lot of things in the part of the website to make this work.
For example, I was missing the fb:admins parameter, part of the OG Protocol.
回答4:
This particular problem you are describing has been reported in this bug: http://bugs.developers.facebook.net/show_bug.cgi?id=18591
but has been marked as resolved since yesterday.
回答5:
Well, I was also having problems with the facebook like plugins and also heard from people that it is a facebook bug. After searching a lot on gOOgle .... I found a good result and don't think that this is a fb bug.
You will have to add this file into the header of your website:
<meta property="og:image" content="http://ia.media-imdb.com/images/rock.jpg" />
Property of Meta Tags (facebook likes Meta Tags) ==> og:image - An image URL which should represent your object within the graph.
Replace "http://ia.media-imdb.com/images/rock.jpg" with real path to image.
For Wordpress Users:
Add the following code in the head of your header file ==>
<?php $img= get_post_meta($post->ID, 'image', true); if ($img): ?>
<meta property="og:image" content="<?=$img ?>"/>
<? endif; ?>
That's all... Hope this will work for you all !! Share your experience ...
来源:https://stackoverflow.com/questions/2995840/facebook-like-button-problem