Search code examples
javascriptphpshareaddthissocial-media

How to always show share counter for AddThis?


I am using AddThis to show social media share buttons. I have used the "Sharing Buttons" tool and I have selected the option to show share counts. However, I believe the count is shown only if there is a significant amount of share.

My question is: Is it possible to always have the share buttons display the share counts even if it is zero?

Here's the code that I got from AddThis:

<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-xxxxxxxxxxxxxxxx" async="async"></script>
<div class="addthis_sharing_toolbox"></div>

Thanks


Solution

  • If you want custom share buttons, you can make something like this: (this code is that I've been used in various projects, and it works fine. It only includes facebook, twitter and g+ but you can add all resources dispossed in addThis)

    <div class="addthis_toolbox addthis_default_style ">
        <table width="100%" border="0">
            <tr>
                <td width="40%"><a class="addthis_button_facebook_like" fb:like:layout="button_count"></a></td>
                <td width="30%"><a class="addthis_button_tweet"></a></td>
                <td width="30%"><a class="addthis_button_google_plusone" g:plusone:annotation="bubble" g:plusone:size="medium"></a></td>
            </tr>
        </table>
        <script>window.___gcfg = {lang: "es"};</script>
    </div>
    <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
    <script type="text/javascript" src="http://s7.addthis.com/js/300/addthis_widget.js#pubid=ra-xxxxxxxxxxxxxxxxx"></script>