Facebook的帖子上的按钮不能正常工作 [英] Facebook like button on posts not working properly
问题描述
确保您在代码中使用正确的数据href像一篇文章。 (您应该参考该单一文章的网址,即使它位于包含多篇文章的网页上)。
例如:
< div class =fb-like
data-href =http://www.yoursite.net/articles/unique-article-
data-send =false
data-layout =button_count
data-width =140
data-show-faces =false
data-font =segoe ui>< / div>
Facebook开发了一个方便的小工具来为您创建代码!
确保您查看> Facebook开发人员页面就像按钮。
当这样做正确的时候,它应该从该链接中获取打开的数据,并同时修复。
您必须确保og数据设置正确。(请访问www.yoursite.net/articles/ unique-article-id-goes-here-or-something-like-that page。)
< meta property = og:titlecontent =文章的标题/>
< meta property =og:typecontent =article/>
< meta property =og:urlcontent =same-url-as-the-data-href-from-like-button/>
< meta property =og:imagecontent =url-to-image-you-like-like/>
< meta property =og:site_namecontent =您的网站名称/
祝你好运!
I am using open graph for the first time. In any url like this you you can see a like button for the site's facebook page at top and another like button after the heading and summary of the article. The second like button is not working as required. If I like from that link then instead of the article the website's facebook page gets liked and the information which I want to show to other facebook users who see that like post is the summary of the article but instead it show that the person like the page alazydude. And the image is also not displaying which I have specified in the open graph tag. The website is still incomplete. I have tried many times now.
Have a look at this page. The second like button in the middle is not working properly.
Make sure you use the correct data-href in your code to like an article. (You should refer to the URL for that single article, even if it's on a page with multiple articles.)
For example:
<div class="fb-like"
data-href="http://www.yoursite.net/articles/unique-article-id-goes-here-or-something-like-that"
data-send="false"
data-layout="button_count"
data-width="140"
data-show-faces="false"
data-font="segoe ui"></div>
Facebook has developed a handy little tool to create that code for you! Make sure you check out the Facebook Developers page on like buttons.
When this is done correctly, it should get the opengraph-data from that link and that would be fixed simultaneously.
You do have to make sure that the og-data is set correctly. (This is on the www.yoursite.net/articles/unique-article-id-goes-here-or-something-like-that page.)
<meta property="og:title" content="Title of the article" />
<meta property="og:type" content="article" />
<meta property="og:url" content="same-url-as-the-data-href-from-like-button" />
<meta property="og:image" content="url-to-image-you-would-like" />
<meta property="og:site_name" content="Name of your site" /
Good luck!
这篇关于Facebook的帖子上的按钮不能正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!