开发者

How can I influence which images facebook shows next to a link to my page?

I wrote a php-redirect script, that sends the user to different pages, depending on which device they used to access the page.

Now if I post a link to the page (www.ibeat.us/i.php) on facebook, facebook doesn't show any of my images I have on this page. If I just add some "echo ..." lines, given the accessin开发者_如何转开发g machine is not running iOS, facebook writes those lines next to my link.


You can use the old image_src

<link rel="image_src" href="http://sample.com/my.jpg" />

Or the new Graph API og:image property

<meta property="og:image" content="http://sample.com/my.jpg" />

If you go by new one, remember to use the Facebook and Open Graph namespaces

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://opengraphprotocol.org/schema/"
 xmlns:fb="http://www.facebook.com/2008/fbml">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜