How Do I Enqueue An External Javascript File?

There are some cases where an external Custom Javascrip file is preferable (maybe you just want to be able to use your favorite code editor) and in such cases the following steps can be used to accomplish this goal:

  • Create a JS file called my-scripts.js (or whatever name you like, but note that if you change the name then you'll have to change the other references to "my-scripts.js" in the following instructions).
  • Upload your my-scripts.js file to your /wp-content/uploads/dynamik-gen/theme/ folder.
  • Add THIS CODE to your Dynamik Custom > Custom Functions.

And that's it! Now you should be able to add your own Custom Javascript code to your my-scripts.js file and have that code affect your website accordingly.

Please Note: By default the above code snippet will place your javascript in the footer of your site (in the source code, not visually present, of course), but if your code needs to be placed in the header instead just change "true" (that comes right after CHILD_THEME_VERSION) to "false".