Facebook - 元标记可能是错的?

时间:2013-03-15 16:50:12

标签: html facebook facebook-graph-api

我刚检查过我的网站在facebook上没有工作。 我为标题,描述,缩略图添加了facebook元标记。

我查看了我的网站,发现它正常运行,我可以在Windows 7中共享链接

但我今天在Windows 8和Linux中查了一下。 (ubuntu和fedora) 他们没有工作,我无法分享链接。

我检查了调试链接,该链接也在工作,并在Windows 7中删除链接细节。但它在linux和Windows 8中不起作用。

我的网站可能出现什么问题? 我怀疑是meta标签。

元标记包含在head标记中。 那是我的doctype和html标签

<meta property="og:title" content="<?php echo $fb_title; ?>"/>
<meta property="og:url" content="<?php echo $fb_url;?>"/>
<meta property="og:image" content="images/<?php echo $fb_images;?>"/>
<meta property="og:site_name" content="<?php echo $fb_page_name;?>"/>
<meta property="fb:admins" content="my_id"/>
<meta property="og:description" content="<?php echo $fb_description;?>"/>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

1 个答案:

答案 0 :(得分:0)

您可以使用此facebook link来测试结果。

如果您还不知道,那么您正在使用Open Graph Protocol

您必须将meta放入<head />部分。

就我而言,当我不想添加Facebook按钮时,我会使用这个DOM:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" >
<head>
<title>My site</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="JoDev, France" />
<meta name="keywords" content="some, word, that, can, resume, the, site" />
<meta property="og:title" content="My site title" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://url.to/your/site" />
<meta property="og:image" content="http://url.to/your/preview/image" />
<meta property="og:site-name" content="My Site name" />
<meta property="og:description" content="Using this, you will be able to reach for the moon" />