【发布时间】:2016-11-28 05:34:29
【问题描述】:
所以,我有这篇文章页面,它有时会发布带有 600x315 尺寸图像的帖子,并且大多小于 100kb。
以下是我在 article.php 网站上使用的元数据,但是当我在 Facebook 上分享帖子时,图像部分显示为空白。我在这些元数据上缺少什么?
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="<?php echo $row['keyword']; ?>">
<meta name="description" content="<?php echo metadesc($row['description']); ?>">
<link rel="canonical" href="<?php echo $site_path.$url; ?>" />
<!-- for Facebook -->
<meta property="og:title" content="<?php echo ucletters($row['title']); echo ' | '; echo $site_name;?>" />
<meta property="og:type" content="article" />
<meta property="og:image" content="<?php echo $site_path.'uploads/images/'.$row['image']; ?>" />
<meta property="og:image:width" content="200" />
<meta property="og:image:height" content="200" />
<meta property="og:url" content="<?php echo $site_path.$url; ?>" />
<meta property="og:description" content="<?php echo metadesc($row['description']); ?>" />
<!-- for Twitter -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="<?php echo ucletters($row['title']); echo ' | '; echo $site_name;?>" />
<meta name="twitter:description" content="<?php echo metadesc($row['description']); ?>" />
<meta name="twitter:image" content="<?php echo $site_path.'uploads/images/'.$row['image']; ?>" />
【问题讨论】:
-
您的 $site_path 是否包含包括“http”在内的完整地址?
-
是的 site.path 就像www。我的网站.com/
-
它确实有 http
-
@AliSheikhpour 你在那儿,伙计?
-
检查网站控制面板并确保图像没有受到热链接保护。也不要在图片网址中使用空格或非英文字符。