2012-01-18 45 views
0

我嘗試做到包含多個og:圖像元屬性以將多個圖像與我的頁面關聯。根據Facebook的Open Graph協議文檔,您只能在html頭部添加多個og:image標籤。Facebook的多個圖像標籤

這就是我所做的,但不幸的是它不起作用。 我會很高興,如果任何人都可以給我一個提示。

代碼:

<head> 
    <meta name="og:title" content="Parents Inc." /> 
    <meta name="og:type" content="website" /> 
    <meta name="og:image" content="http://theparentingplace.automatem.co.nz//images/stories/media/Our%20Speakers/amanda_headshot.jpg" /> 
    <meta name="og:image" content="http://theparentingplace.automatem.co.nz//images/stories/media/Our%20Speakers/bruce_headshot.jpg" /> 
    <meta name="og:image" content="http://theparentingplace.automatem.co.nz//images/stories/media/Our%20Speakers/dave_phoebe_headshot.jpg" /> 
    ... 
    <meta name="og:image" content="http://theparentingplace.automatem.co.nz//images/stories/media/Our%20Speakers/zane_headshot.jpg" /> 
    ... 

你可以看到一個例子頁面在這裏:

http://pastehtml.com/view/bl3wbdtiu.html

回答

2

http://pastehtml.com/view/bl3wbdtiu.html

這有

<meta name="og:title" content="Parents Inc.">

應改爲

<meta property="og:title" content="Parents Inc.">

您還應該添加xmlns:og="http://ogp.me/ns#"爲你的HTML標籤的屬性了。 <html prefix="og: http://ogp.me/ns#">或類似<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xmlns:fb="https://www.facebook.com/2008/fbml">

進一步閱讀可以做到:http://ogp.me/https://developers.facebook.com/docs/opengraph/

+0

乾杯後腰的名稱,而不是財產是問題 – Andreas 2012-01-18 20:32:02

+0

容易忽略!樂意效勞。 – DMCS 2012-01-18 21:46:25