Jump to content

Archived

This topic is now archived and is closed to further replies.

dreamsight

Add script immediately before </body> tag

Recommended Posts

dreamsight

I had added a custom script in Custom>Custom Scripts

 

But Zoho have come back to me with this...

 
Instruction to Web Master
1. Capture & Store Google AdWords Information:
Place the below mentioned tracking code at the bottom of every pages of your website. Make sure you paste it immediately before </body> tag.
<script type="text/javascript" src="http://crm.zoho.com/crm/javascript/zcga.js"></script>

 

Please can you let me know how can I do this?

Thanks

Share this post


Link to post
Share on other sites
dreamsight

There's this in footer.php

	print_pagelines_option('footerscripts'); // Load footer scripts option
	wp_footer(); // Hook (WordPress)

And I've tried Hook wp_footer and pagelines_after_footer but it's not them. Which hook can I select to get my script here?

Share this post


Link to post
Share on other sites
Danny

If you wish to add a script or scripts above the closing body tag, you will need to use the WordPress wp_footer hook or enqueue the script.

 

http://wordpress.stackexchange.com/questions/51138/how-to-add-javascript-just-before-the-closing-body-tag-in-the-footer-of-wordpres


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
dreamsight

I've tired the Hook wp_footer and it didn't work

Share this post


Link to post
Share on other sites
Danny

What code did you use ?

 

The wp_footer action is triggered near the </body> tag of the user's template by the wp_footer() function. Therefore, if it is not working, then your code isn't correct. There is an example on the WordPress codex for the wp_footer action - http://codex.wordpress.org/Plugin_API/Action_Reference/wp_footer


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Danny

What do you mean, you only added the scripts URL ?

Where did you add that scripts URL too ?


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
Danny

Can you provide the code you have used i.e what does your hook wp_footer code look like and where did you add the hook?


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • Lisa Haran
      By Lisa Haran+
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
    • clj182
      By clj182+
      Hello,
      I've been having trouble unlocking the template section for past couple of weeks. When I try clicking nothing happens. 
      I've deleted my custom css and removed plugins. Im down to having only the following plugins:
      Akismet
      Contact Form 7
      DMS Professional Tools
      Pagelines Updater
      WooCommerce
      It was working fine before i have no idea what's going on with it.
    • flourishdesignstudio
      By flourishdesignstudio+
      My DMS 2 site http://www.heart-stone.com/ will not save any new custom css... I can still edit templates and publish those but any custom css that I enter never saves.
      All WP files, themes, and plugins are up to date. 
      Any thought about what might be causing this?
    • flourishdesignstudio
      By flourishdesignstudio+
      Is there a way to edit the custom CSS via FTP? I know I can edit the custom code in the Chrome editor but is there a file path I can use to find and edit the CSS directly from our FTP?
      Thanks in advance for the help!
    • nizami
      By nizami+
      Using navbar section with correctly configured WP menu to display main navigation at https://elenaangel.com. 
      All fine in desktop viewport. Menu displays twice in hamburger mode. How to fix this please? 

×