我在我的wordpress头文件中有这个,由Facebook应用程序对象类型“获取代码”列表指定:
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# clubapp: http://ogp.me/ns/fb/clubapp#">
<meta charset="utf-8">
<title><?php echo $recipe_title; ?></title>
<meta property="fb:app_id" content="12349845123" />
<meta property="og:type" content="clubapp:reference" />
<meta property="og:url" content="https://club.com/miko_index_temp/" />
<meta property="og:title" content="nice" />
<meta property="og:image" content="https://fbstatic-a.akamaihd.net/images/devsite/attachment_blank.png" />
现在,当我尝试使用其中刮刀应该读取这些标签的opengraph调试器(https://developers.facebook.com/tools/debug/og/object/)时,我收到一条错误,说“URL上的对象”......“类型为”网站'无效,因为未提供“string”类型的必需属性'og:title'。
我查看了screaped网址,并且没有显示meta标记。有谁知道为什么会这样?
答案 0 :(得分:0)
这终于有效了。
问题是之前的一些PHP代码阻止了元标记的被删除,我通过将这些代码放在头文件的最顶层并将url再次放入调试器来测试它们。
修改完代码后,我终于从调试器中获取了所有的og元标记,如url,image,type等。