[Plugin: AddThis] Buttons not loading with AJAX theme
-
Hi all,
I hope someone can help me because I have tried many potential solutions to no avail! I am trying to include AddThis share buttons underneath each post in a WordPress AJAX theme, and am having trouble getting the code right. Here is the website in question: http://www.jaesonma.net/
I inserted the following code in the custom button field on the settings page:
<div class="addthis_toolbox addthis_default_style" id="toolbox"></div>Then in the post loop in the main page PHP file I have this:
<script> var tbx = document.getElementById("toolbox"), svcs = {email: 'Email', print: 'Print', facebook: 'Facebook', expanded: 'More'}; for (var s in svcs) { tbx.innerHTML += '<a class="addthis_button_'+s+'">'+svcs[s]+'</a>'; } function ReinitializeAddThis() { if (window.addthis) { window.addthis.toolbox("#toolbox"); }; </script> <iframe style="display: none;" onload="javascript:ReinitializeAddThis();"></iframe>This is all code that I’ve cobbled together from various other threads and support pages. The addthis:url and addthis:title are being added to the toolbox div, but is not populating with sharing buttons so I know I’m doing something wrong. I also enabled buttons through the settings page, and that toolbox div is being populated with empty link tags but no buttons. I’m not as familiar with AJAX/JQuery as I’d like to be, so I’m hoping someone can point out where the code goes wrong and perhaps help get it working properly. I’d really appreciate any insight and I apologize if anything is unclear. Thanks!
The topic ‘[Plugin: AddThis] Buttons not loading with AJAX theme’ is closed to new replies.