Facebook "like" button shows count of homepage instead specific article
I have a website with a news section, and I want to put individual "like" buttons in each post. The problem is that the buttons shows the root like count and not the count of that specific page/post.
And the weirdest is that it works in one of the pages, but not in the others.
This is the page with the buttons working and this is one of the pages where te button isn't working.
I've already read all the content of facebook's social plugin and open graph, and I still don't understand what's happening.
This button don't work:
<div id="fb-root"></div><script src="http://connect.facebook.net/en_US/all.js#appId=218284238205675&xfbml=1"></script><fb:like href="http://eepolitecnica.org.br/noticias/valor_poli_cria_primeiro_fundo_de_universidade/" send="true" layout="button_count" width="150" show_faces="false" font=""></fb:like>
and this works fine:
<div id="fb-root"></div>开发者_高级运维<script src="http://connect.facebook.net/en_US/all.js#appId=170199966377672&xfbml=1"></script><fb:like href="http://eepolitecnica.org.br/noticias/jornal_nacional_exibe_materia_sobre_o_eep" send="true" layout="button_count" width="150" show_faces="false" font=""></fb:like>
These are some relevant meta tags I have
<meta property="og:type" content="article" />
<meta property="og:url" content="<?php echo $base_url, $site_url; ?>" />
Is that a common bug from FB's Like button as it seems or I'm really doing something wrong?
Sorry about my terrible english...
Remove the trailing slash in the version that doesn't work. This trailing slash is causing your urls not to match and so facebook is defaulting back to the base url
eg:
<fb:like href="http://eepolitecnica.org.br/noticias/valor_poli_cria_primeiro_fundo_de_universidade" send="true" layout="button_count" width="150" show_faces="false" font=""></fb:like>
Try using FB's linter tool: https://developers.facebook.com/tools/lint/
Enter the URL for your different pages and see what FB is actually seeing from the XFBML tags on your page. This might shed more light or post back results here.
Try this
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
<fb:like href="http://www.facebook.com/account-name" send="true" layout="button_count" width="150" show_faces="false" font=""></fb:like>
精彩评论