AddThis Issue with 2 Tweet Buttons on Page | not firing | WordPress


I’m testing a application that I custom building. So the tweet button will show within the contents of a post or page. But AddThis also adds a tweet button at the bottom or each post / page.

If I do NOT have AddThis show (with tweet button) on the WordPress page the follow & tweet events fire just fine.
But when I have the AddThis appear on a page it doesn’t work anymore. The tweet pop-up box opens and tweets just fine but the never fires.

I tried to remove this when AddThis is enabled for the page. Just in case it was being loaded twice but still the same issue.

<script type="text/javascript" src=""></script>

BUT if I have AddThis enabled for the page and NOT have the tweet button show up so the tweet button I’ve created shows within the content of the post / page it works… So the issue is when there are 2 tweet buttons. One from me within the content and another from AddThis at the end of the post / page.

Any ideas?

Here is the full code:

				<script type="text/javascript" src=""></script>				
				<script type="text/javascript">'tweet', function(event) {
					alert("Twitter Lottery Entry Successful");
				});'follow', function(event) {
					document.getElementById("twitterStep1").style.display = "none";
					document.getElementById("twitterStep2").style.display = "block";

                               <a href="" class="twitter-share-button" 

And here is the code that AddThis adds:

<!-- AddThis Button BEGIN -->
<script type="text/javascript">
var addthis_product = 'wpp-250';

<div class="addthis_container addthis_toolbox addthis_default_style" addthis:url="" addthis:title="Lottery 1"><a href=";username=ps3blogdotnet" class="addthis_button_compact"></a><a class="addthis_button_tweet"></a><a class="addthis_button_facebook_like"></a><a class="addthis_button_google_plusone"></a><script type="text/javascript" src=""></script></div>
<!-- AddThis Button END -->


Can you post the code which AddThis is inserting into your page? I tried to reproduce your error by including two separate event listeners on a page, but both callbacks fired correctly…


Thank you for the reply. I updated the original post with that code.


Thanks, unfortunately it appears that it’s really the AddThis file at which is breaking events (if you don’t use AddThis and add two “tweet” event listeners, both get called, so the code on Twitter’s end should be working).

Since their code is compacted, it’s really difficult for me to try and figure out what they might be doing to break the events system. Have you contacted them to ask about this issue?


Thanks for the reply. I actually did another test where my application and a regular follow button in the sidebar showed up. The event listeners don’t fire … no addThis on the page that time.

So seems like anything with 2 tweets or 2 follow buttons breaks it.

This is my twitter follow button in the sidebar:

Follow @ps3blogdotnet


Any ideas why?


This was the use case I tested - the following code did trigger events:

Tweet Tweet more Follow

Perhaps you left the AddThis script include in your source?


Not sure if I mentioned this was in WordPress. The follow button I had was in the sidebar. But I had AddThis disabled to show on pages. So no addthis sharing showed up. But didn’t work.

But if I removed the sidebar and added another follow button or have 2 tweet buttons. It DOES work … mm

I search for references of AddThis in the source when I had the sidebar showing but nothing… so not sure why it’s still breaking. So weird…

2. 11. 12. Tweet


What worked for me is renaming the addthis_toolbox classes different. So, for one of them I left it alone as addthis_toolbox and the second one I simply added a 2 like this addthis_toolbox2. Might be something as small as that and simple, but it helped me out. Hope it helps.