Site logo

Archived topic

Footer code is not getting inserted

9 replies · Started by Michael on January 29, 2020

Viewing posts 1–10 of 10

Hi all,

I am trying to add the following footer script:

<script src="https://www.reclaimdesign.org/uploads/2/4/9/8/24985082/custom_themes/606760176814155089/files/socialsharing.min.js" async="async"></script>

I have tried adding to wp-footer with the code snippets, but when I check View Source I don't see it anywhere on the page code.

I have also tried this plugin - https://wordpress.org/plugins/insert-headers-and-footers/ - but it doesn't seem to work either, so I'm not sure what I'm doing wrong.

I have tried clearing the cache in WP and in the browser. Neither helped.

I used the JS template in code snippets and kept all settings as they default. I noticed that one of the options is "Only run on site front end". Could this be the problem? As I say, this was selected as the default so I left it at that.

I have various scripts I made for our current site that I will need to add in to the footer so it's quite important for me to get this working without pulling out the little remaining hair I have ;)

Please could you help?

Michael.

Here's my test site- https://reclaimdesign-383226.easywp.com/about-reclaim-design.html

Hi there,

i can see the script in the <head> of your site ..... can you check the right hook is enabled? :)

Also can you disable any cache/optimization plugins including autoptimize and then let us know so we can take another look.

David you are absolutely right. I'm sorry for wasting your time. I couldn't see the wp_head bit at all....

Glad to be of help :)

Hi again David,

I have another question! The footer code is there, but for some reason it is not working when I am calling it from the share buttons at the bottom of the page just above the footer area. This worked great for my current site https://www.reclaimdesign.org and I don't understand why not now.

I have an onclick event for each of the social share buttons eg:

onclick="setShareLinks('FB');"

Which is meant to call that function which is within the js file in the footer. As I say, it does this on my current site but it's not happening at all on this test site:

https://reclaimdesign-383226.easywp.com/about-reclaim-design.html

Please can you help me work out what I am not seeing?

The jQuery script is using the $ function which WP doesn't natively support it has to be declared. Or replace all $ with jQuery in the code.

Thank you David - I would not have worked that out on my own (or at least probably not for several days!) - I really appreciate the help

Glad to be of help.

Woohoo! That works! Thank you David - you're a legend!

I'm glad you're glad to be of help, or I'd be stuffed otherwise ;)

This archived topic is closed to new replies.