• Resolved Daniel

    (@drstout)


    I’ve added the sharing widget to posts. The HTML tags for the sharing buttons are being inserted. The CSS file is showing up in the wp_footer(). But the JavaScript is nowhere to be found, so the sharing widget is not showing.

    I’ve tried turning asynchronous loading off, but no change. The plugin is working on another site I use, but on this site the AddThis JavaScript is not being inserted into the page.

    Here’s a sample post where the buttons are not showing:
    https://danielstout.com/2016/01/play-for-today/

    Can this be fixed?

    https://www.ads-software.com/plugins/addthis/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Daniel

    (@drstout)

    I got this working on another site that’s configured nearly identical to the site that’s not working. The only meaningful difference is that the site that AddThis is not working on is an HTTPS only site. It is only available through a secure session. The other sites I’ve tested primarily use HTTP. Not sure if that’s the issue, but so far that’s the only difference I’ve noticed.

    I’m having the same problem.

    I’ve got it working on my local development site, but it just won’t call in the javascript into the staging or live sites, which are identical, except that they are hosted on a digitalocean droplet instead of locally.

    I’d be really grateful if anyone has a suggestion of what may be the problem here.

    Plugin Contributor Julka Grodel

    (@jgrodel)

    Hi Dr. Stout.

    I’m seeing the AddThis script inserted on the URL you mention, and the sharing sidebar is appearing on that page as well. Are you still having this issue on other pages?

    And Hello Delythchandler!

    Do you have a URL I could look at that isn’t doing what you expect with AddThis?

    Thanks,
    Julka

    Thread Starter Daniel

    (@drstout)

    Hi, Julka — It was a curious problem with a curious solution. The AddThis JavaScript wasn’t being inserted into any pages. I finally fixed it by selecting a different theme, and then immediately switching back to the original theme. After that, the JavaScript appeared correctly.

    I’m having an almost identical issue to Dr Stout. The addthis plugin works fine on my test platform, but not on live.

    Looking at the page source, the addthis css file is being added to the footer, but not the preceding Javascript blocks that I can see on my dev platform.

    There are no JS errors being reported.

    I’m very nervous about attempting Dr Stouts solution however, as the live site is very high traffic and any theme fiddling will cause problems.

    Julka do you have any idea what might be stopping the addthis JS from being written to the page please?

    Thanks!

    Plugin Contributor Julka Grodel

    (@jgrodel)

    Hi TwoThirdsWater.

    Do you have a caching plugins installed? My guess would be that Dr. Stout’s solution worked because it triggered a caching plugin to clear its cache. You should be able to do that manually from the settings of the caching plugin.

    This is my only guess as to why switching themes worked for him.

    Thanks,
    Julka

    Hi Julka

    Many thanks for the pointer.

    Clearing the cache (and running all available updates) has gone some way to fixing the problem. The share icons are now appearing on the post pages, but not on the homepage or category pages.

    The sidebar is configured to appear on the homepage (and all other templates).

    Do you have any other suggestions please?

    Thanks again for your help…

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘JavaScript not being inserted into page’ is closed to new replies.