添加此共享与自定义共享按钮

时间:2013-11-07 13:37:27

标签: share addthis

我需要在我的网站上添加一个共享功能。

这个php页面应该允许用户在社交网络上分享我的网站,但我需要设置自定义网址,标题,描述和图像。

我尝试使用addthis共享按钮,但我不确定是否可以完全自定义按钮......对吗?

还有其他类似的服务吗?或者在我的情况下最好添加分享按钮与facebook api,twitter api,..?

这是addthis共享代码:

<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
<a class="addthis_button_preferred_1"></a>
<a class="addthis_button_preferred_2"></a>
<a class="addthis_button_preferred_3"></a>
<a class="addthis_button_preferred_4"></a>
<a class="addthis_button_compact"></a>
<a class="addthis_counter addthis_bubble_style"></a>
</div>
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=xx"></script>

2 个答案:

答案 0 :(得分:0)

您可以通过在工具箱HTML中指定addthis:title,addthis:url和addthis:description标签来设置自定义标题,网址和说明,如下所示:

<div class="addthis_toolbox addthis_default_style addthis_32x32_style"
    addthis:url="http://example.com"
    addthis:title="An Example Title"
    addthis:description="An Example Description">

但是,Facebook和其他一些服务并不尊重发送给他们的价值,并为og:title,og:url和og:description标签抓取您的页面。因此,为了安全起见,请在AddThis代码中指定上述内容,并为og标记指定相同的值。您可以在此处阅读有关og标签的更多信息:

http://www.addthis.com/blog/2012/09/27/debugging-sharing-to-facebook

答案 1 :(得分:0)

你可以试试这个:你可以试试这个:http://sharebuttongenerator.aakilfernandes.com/

相关问题