[Resolved] Footer code is not getting inserted

Home Forums Support Footer code is not getting inserted

  • This topic has 9 replies, 2 voices, and was last updated 12 months ago by Michael.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1148300
    Michael

    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

    #1148322
    David
    Staff
    Customer Support

    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.

    #1148325
    Michael

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

    #1148327
    David
    Staff
    Customer Support

    Glad to be of help πŸ™‚

    #1148339
    Michael

    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?

    #1148405
    David
    Staff
    Customer Support

    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.

    #1148410
    Michael

    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

    #1148418
    David
    Staff
    Customer Support
    #1148420
    Michael

    Woohoo! That works! Thank you David – you’re a legend!

    #1148422
    Michael

    I’m glad you’re glad to be of help, or I’d be stuffed otherwise πŸ˜‰

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.