dashed-slug.net › Forums › Exchange extension support › ? – Exchange Chart Timeframe › Reply To: ? – Exchange Chart Timeframe
Hello Megan,
The above JavaScript code can be added by enqueueing it as part of your child theme. Use wp_enqueue_script()
in your functions.php file to reference the .js file: https://developer.wordpress.org/reference/functions/wp_enqueue_script/
You should not have to worry about dependencies: the code does not reference the wp
object on the first pass. If the event is trigerred, this means that all the prerequisites have already been loaded. Simply give a unique handle and the path to the script, like so:
wp_enqueue_script('my-wallets-exchange-js', '/path/to/your/javascript.file.js' );
If you don’t want to enqueue the script, there are also plugins that let you easily add JavaScript tags to your pages. For example, with a quick search I found this: https://wordpress.org/plugins/header-and-footer-scripts/
with regards