我只是偶然发现在Facebook和Linkedin上分享一个文本(一个标签)与一个文本一起分享。这是我试图做的hwat(标签:#STUFF)。
<li class="facebook"><a target="_blank" href="http://www.facebook.com/share.php?u=<?php echo '#STUFF'. urlencode(get_the_permalink()); ?>">facebook</a></li>
这个,不幸的是不能用(难怪!)有 "说点什么吧" 字段。我是否可以在分享按钮上添加一段代码,使该字段包含以下文字 (就像用 "subject "发送邮件一样)。
我在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>
虽然我不确定其他服务,但你可以在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.comdocsshare-onlinkedin。
脸书
使用sharer,你只能指定 url
,像这样的...
https://www.facebook.com/sharer.php?u={url}
来源 Facebook分享者文档.
但是,如果你注册了你的应用,获得了应用ID,并安装了Facebook分享对话框插件,那么你几乎可以无限制地指定分享......
https://www.facebook.com/dialog/share?app_id={app_id}&display={page_type}&href={url}&redirect_uri={redirect_url}
来源于: Facebook对话文档.
所以,你不能真正指定任何 text
在LinkedIn上分享时。 您只能设置 url
参数。 但你可以设置 og:
标签显示 title
, image
、等,在你的分享页面中作为预览。
<meta property='og:title' content='Title of the article"/>
<meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
<meta property='og:description' content='Description that will show in the preview"/>
<meta property='og:url' content='//www.example.com/URL of the article" />
来源: LinkedIn开发者文档。让你的网站可以在LinkedIn上分享.
验证你的做法是否正确,用:的。LinkedIn职位检查员.
BUT,类似于Facebook,如果你注册了你的应用,获得了一个appid等,你完全可以尽情的使用这种形式....
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": "Hello World! This is my first Share on LinkedIn!"
},
"shareMediaCategory": "NONE"
}
来源:微软LinkedIn 微软LinkedIn文档。在LinkedIn上分享.