LightSpeed Webstore: Don’t want button count in twitter button? Edit sharing.tpl.php

After spending a stupid amount of time trying to fit all the sharing buttons side by side in the exact same vertical alignment in a really small space (256 pixels with some padding on the left) I was about to shoot myself.

Instead, I decided to just go to Twitter and create the button all over again and stick the new code in sharing.tpl.php. The new button I made did not have button count turned on.

https://twitter.com/about/resources/buttons#tweet

Why did I not want the button count? Because with the button count turned on the Twitter button was created by JavaScript to be 120 pixels in width and had to be placed last or there was a big old gap between it and the next button. The actual size of the button is really only about 56 pixels. It’s the button count that adds all the extra width.

I opened mytemplate/sharing.tpl.php and found the twitter button stuff highlighted it and pasted this code in its place:

[php]
<a href="https://twitter.com/share" class="twitter-share-button" data-count="none">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
[/php]

You’ll notice the default twitter button code already has the data-count=”none” so what gives?

I have to admit I have expended as many braincells as I care to with this issue so I am not using any more trying to figure out why the default button code with data-count=”none” showed the button count but the one I got over at Twitter’s button maker didn’t.