当我在Facebook上分享网址时,标题没有显示 [英] Title doesn't show up when I share url on facebook

查看:75
本文介绍了当我在Facebook上分享网址时,标题没有显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在Facebook上与标题共享网址.我

I try to share url on facebook with title. I do

http://www.facebook.com/sharer/sharer.php?u=http://domain.com/win-a-hot-date/&t=Now this is awesome

,但标题未显示.怎么了?

but title doesn't show up. What's wrong?

推荐答案

不推荐使用't'url参数以及sharer.php

The 't' url parameter has been deprecated as well as sharer.php

下面提供了一个适合您的示例链接(始终对参数值进行编码):

Herewith an example link that should work for you (always encode parameters values):

https://www.facebook.com/sharer/sharer.php?s=100&p[url]=http%3A%2F%2Fdomain.com%2Fwin-a-hot-date%2F&p[title]=Now+this+is+awesome

您可以将这些参数添加到末尾以显示缩略图或摘要:

You could add these parameters to the end to show thumb images or summary:

&p[images][0]=*URL_TO_IMAGE*
&p[summary]=Some+urlencoded+summary

(通常建议将所有与号&替换为HTML的& amp;)

(it is normally advisable to replace all ampersands & with HTML's & equivalent)

但是,如上所述,这是一种已弃用的api方法,使用上述方法可能会产生各种结果,即有时图像不支持它.

Though, as stated above it's a deprecated api method and using the above can produce various outcomes i.e. sometimes images not there is support for it.

有些人报告标题或图像不方便的问题,不得不在文档的head标签中用HTML代码实现OG标签:

Some people reported problems with titles or images not shoeing and had to implement OG tags within their document's head tags in HTML code:

<meta property="og:title" content="The Rock"/>
<meta property="og:type" content="movie"/>
<meta property="og:url" content="http://www.imdb.com/title/tt0117500/"/>
<meta property="og:image" content="http://ia.media-imdb.com/rock.jpg"/>
<meta property="og:site_name" content="IMDb"/>
<meta property="fb:admins" content="USER_ID"/>
<meta property="og:description" content="Some descrioton"/>

注意:Facebook建议的一种新方法是使用.

NOTE: a new suggested by Facebook way is to use Feed and Share Dialogs described here. For debuging use this.

这篇关于当我在Facebook上分享网址时,标题没有显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆