Facebook喜欢网页按钮说明 [英] Facebook like webpage button description
问题描述
我看到网页标题,链接,图片,但我无法得到任何描述。当用户点击网页时,我的客户想要一个描述文字。这是不可能的吗?
I see the webpage title, link, image, but I cannot get any description. My client want's a describing text when a user has clicked like on the webpage. Is this not possible??
我不得不使用旧的分享方式,因为新的不与网站上的其他东西一起工作。
I had to use the old way of sharing since the new doesn't work together with the other things on the site.
我已经通过Facebook调试器运行,唯一的问题是:
I have ran it through the Facebook Debugger and the only problem it states is:
Open Graph Warnings That Should Be Fixed:
Parser Mismatched Metadata: The parser's result for this metadata did not match the input metadata. Likely, this was caused by the data being ordered in an unexpected way, multiple values being given for a property only expecting a single value, or property values for a given property being mismatched. Here are the input property =>content pairs that were not seen in the parsed result: 'og:description => the site desc'
但是我认为这只是因为我使用 meta name =description>
。因为它在调试器中获取并显示此信息:
However I think this is only because I use <meta name="description">
as well. Because it does fetch and display this information in the debugger:
Raw Open Graph Document Information
Meta Tag: <meta property="og:url" content="http://website.nu/" />
Meta Tag: <meta property="og:image" content="http://website.nu/img/img200x200.jpg" />
Meta Tag: <meta property="og:title" content="website title" />
Meta Tag: <meta property="og:type" content="website" />
Meta Tag: <meta property="og:site_name" content="site_name" />
Meta Tag: <meta property="fb:admins" content="[my fb id]" />
Meta Tag: <meta property="og:description" content="site desc" />
网站源代码:
Website source code:
<head>
<meta name="description" content="Page description">
<meta property="og:url" content="http://website.nu/"/>
<meta property="og:image" content="http://website.nu/img/img_200x200.jpg"/>
<meta property="og:title" content="Site title"/>
<meta property="og:type" content="website"/>
<meta property="og:site_name" content="Site name"/>
<meta property="fb:admins" content="[my_fb_id]"/>
<meta property="og:description" content="Page description, expected to output"/>
</head>
<body>
<iframe src="http://www.facebook.com/plugins/like.php?href=http://website.nu/index.php/&send=false&layout=button_count&width=90&show_faces=false&action=like&colorscheme=light&font&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:94px; height:20px;" allowTransparency="true"></iframe>
</body>
推荐答案
尝试 trim 您的内容,例如:
echo '<meta property="og:description" content="' . trim($content) . '"/>';
这篇关于Facebook喜欢网页按钮说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!