问题
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.
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'
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>
回答1:
Try putting the <meta name="description"> tag after the <meta property="og:description"> tag.
回答2:
The og:description needs to be after the og:image property. At least that was working for me. description after og:description or removing the description-metatag didn't change anything.
回答3:
try to trim your content for example:
echo '<meta property="og:description" content="' . trim($content) . '"/>';
来源:https://stackoverflow.com/questions/10446878/facebook-like-webpage-button-description