0

我看到网页标题、链接、图片,但我无法获得任何描述。当用户在网页上单击时,我的客户想要一个描述文本。这不可能吗??

我不得不使用旧的分享方式,因为新的方式不能与网站上的其他东西一起使用。

我已经通过 Facebook Debugger 运行它,它指出的唯一问题是:

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">也使用。因为它确实在调试器中获取并显示此信息:

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" /> 

网站源代码:

<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/&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:94px; height:20px;" allowTransparency="true"></iframe>
</body>
4

3 回答 3

0

尝试修剪您的内容,例如:

echo '<meta property="og:description" content="' . trim($content) . '"/>';
于 2012-07-24T22:52:13.303 回答
0

og:description 必须在 og:image 属性之后。至少那对我有用。og:description 之后的描述或删除 description-metatag 并没有改变任何东西。

于 2012-05-08T12:55:49.903 回答
0

尝试将 <meta name="description"> 标签放在 <meta property="og:description"> 标签之后。

于 2012-05-04T21:31:07.420 回答