Addthis:更改发送的描述,标题和URL [英] Addthis: Changing Description, Title, and Url being sent

查看:105
本文介绍了Addthis:更改发送的描述,标题和URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用PHP建立一个论坛,我希望用户能够使用Addthis社交插件将每个帖子的标题和描述分享到Facebook,Twitter,... etc.这是Addthis给我的代码:

I am building a forum in PHP and I want users to be able to share the title and description of each post to facebook, twitter, ...etc using the Addthis social plugin. Here is the code Addthis has given me:

    <!-- AddThis Button BEGIN -->
    <div class="addthis_toolbox addthis_default_style "
        addthis:url="www.example.com"
        addthis:title="Example Title"
        addthis:description="Example Description">
    <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="http://s6.addthis.com/js/154/addthis_widget.js#pubid=rd-39e8r89e9er8er989"></script>
    <!-- AddThis Button END -->

我可以将URL更改为我指定的另一个URL,但是更改标题和描述无效.实际上,当我单击共享"按钮并将其发布到我的Facebook墙上时,它们甚至都不会显示.使它正常工作的正确方法是什么?

I was able to change the url to another I have specified, but changing the title and description has no effect. In fact, they do not even show up when I click the share button and post it to my facebook wall. What is the proper way to get this to work?

推荐答案

AddThis并不正式支持所有这些参数(我无法在它们的文档中一次找到所有这些参数)您应该只在所在页面上使用OpenGraph标记.但是无论如何...

AddThis doesn't officially support all these parameters as far as I can tell (I can't find them all in once place in their documentation), so ideally you should just use OpenGraph tags on the page you are on. But in any case...

您需要在自定义按钮本身而不是在工具箱上指定它.您甚至可以指定图像.如果您的按钮必须来自AddThis,而不是自己指定按钮,则不确定.

You need to specify it on the custom buttons themselves, not on the toolbox. You can even specify the image. If your buttons have to come from AddThis instead of specifying them yourself, I'm not sure.

<div class="addthis_sharing_toolbox">
    <a class="addthis_button_facebook"
        addthis:url="http://google.com/"
        addthis:title="Here's a title"   
        addthis:media="http://images.google.com/example.png" 
        addthis:description="Here's a cool description">
        <i class="ico ico-facebook"></i>
    </a>

    <a class="addthis_button_twitter"
        addthis:url="http://google.com/"
        addthis:title="Here's a title"   
        addthis:media="http://images.google.com/example.png" 
        addthis:description="Here's a cool description">
        <i class="ico ico-twitter"></i>
    </a>

    <a class="addthis_button_linkedin"
        addthis:url="http://google.com/"
        addthis:title="Here's a title"   
        addthis:media="http://images.google.com/example.png" 
        addthis:description="Here's a cool description">
        <i class="ico ico-facebook"></i>
    </a>
</div>

AddThis的文档很烂,所以我碰巧碰到了正确的事情并弄清楚了.享受吧!

AddThis's documentation sucks so I just happened to run into the right things and figure this out. Enjoy!

这篇关于Addthis:更改发送的描述,标题和URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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