2015-08-15 63 views
0

我刚刚偶然发现在Facebook/LinkedIn上分享文本(标签)与文本。这里是HWAT我试图做(包括hashtag:#STUFF):在FB和LINKEDIN上用页面文本共享一个TEXT alonsgide?

<li class="facebook"><a target="_blank" href="http://www.facebook.com/share.php?u=<?php echo '#STUFF'. urlencode(get_the_permalink()); ?>">facebook</a></li> 

本,遗憾的是不工作(!怪不得) 有“说些什么东西” 关于FB场。 我可以向共享按钮添加一段代码,以便该字段包含文本(非常类似于用于电子邮件发送的“主题”)。

我可以用Twitter做到这一点。就像这样:

<li class="twitter"><a target="_blank" href="https://twitter.com/intent/tweet?text=<?php echo urlencode(get_the_title() . ', #STUFF'); ?>&url=<?php echo urlencode(get_the_permalink()); ?>&original_referer=<?php ?>">twitter</a></li> 
+0

不,不,我是问不同的东西! hashtag只是一个例子。基本上我只需要在网站的标题和网址t在FB上共享之前添加A PIECE OF TEXT。 – Rossitten

+2

Facebook不允许这样做。用户必须输入整个消息,并且您的应用不得以任何方式预先填写或修改。 – CBroe

+0

谢谢!是啊 - 我现在已经认为出来了=( LinkedIn怎么样?貌似谎言它也是不可能的 – Rossitten

回答

1

虽然我不确定其他服务,您可以使用此格式自定义LinkedIn上分享文本(请注意,所有的{}占位符值应与URL编码值替换):

<a href="https://www.linkedin.com/shareArticle?mini=true&url={URL to share}&title={article title}&summary={article summary}&source={your app/website name}">Link text</a> 

例如

<a href="https://www.linkedin.com/shareArticle?mini=true&url=http://developer.linkedin.com&title=LinkedIn%20Developer%20Network&summary=My%20favorite%20developer%20program&source=LinkedIn">Link text</a> 

共享内容的完整文档可以在这里找到:https://developer.linkedin.com/docs/share-on-linkedin

相关问题