如何影响Facebook在我的网页链接旁边显示的图片? [英] How can I influence which images facebook shows next to a link to my page?
问题描述
我写了一个php-redirect脚本,它将用户发送到不同的页面,这取决于他们用来访问该页面的设备。
I wrote a php-redirect script, that sends the user to different pages, depending on which device they used to access the page.
现在,如果我发布链接到页面(www.ibeat.us/i.php)在Facebook上,Facebook没有显示我在这个页面上的任何图像。
如果我只是添加一些echo ...行,给定访问机器不运行iOS,Facebook将这些行写在我的链接旁边。
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 accessing machine is not running iOS, facebook writes those lines next to my link.
推荐答案
您可以使用旧的 image_src
<link rel="image_src" href="http://sample.com/my.jpg" />
或新的Graph API og:image
属性
Or the new Graph API og:image
property
<meta property="og:image" content="http://sample.com/my.jpg" />
如果你用新的,请记住使用Facebook和打开图表名称空间
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">
这篇关于如何影响Facebook在我的网页链接旁边显示的图片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!