2014-09-24 26 views
0

我有一個分享按鈕,我試圖根據自己的具體需求進行修改。這是代碼。我需要添加到這個facebook og元數據?

<html xmlns="http://www.w3.org/1999/xhtml" 
xmlns:og="http://ogp.me/ns#" 
xmlns:fb="http://www.facebook.com/2008/fbml"> 
<html> 
<meta property="fb:app_id" content="lotsanumbers" /> 
<meta property="og:title" content="FOR SALE"/> 
<meta property="og:type" content="product"/> 
<meta property="og:url" content="http://www.website.com.au/php_test.php"/> 
<meta property="og:image" content="http://www.website.com.au/ddfut14-1148.jpg"/> 
<meta property="og:description" content="http://www.website.com.au/php_test.php<?php echo $title; ?>" /> 

一切工作的要求除了OG:描述。當我正在使用Facebook調試只看到

<meta property="og:description" content="http://www.website.com.au/php_test.php 

它不是從同一行我失去了什麼刮

<?php echo $title; ?> 

+0

讓我知道,如果你需要做的工作與我聯繫mohit5783 @ gmail的.com – 2014-09-24 09:46:34

回答

0

og:description是應該包含文本標籤,你應該做的事情,如:

<meta property="og:description" content="<?php echo $title; ?>" /> 
//where $title should be a defined variable that contains some text 

<meta property="og:description" content="<?php echo file_get_contents("http://www.website.com.au/php_test.php"); ?>" /> 
//where your php_test.php file should echo out text 
+0

感謝Sudhir我嘗試了兩個選項,結果相同....... Meta Tag \t .... Facebook無法識別PHP – user2432677 2014-09-24 08:00:11

相關問題