How to add JavaScript file using wp_enqueue_scripts?
In WordPress you should enqueue your scripts (and styles) using the wp_enqueue_scripts action hook. The main reason for this is to ensure that your script/style is only added once. You can, if you wish, aslo add conditions so that a script/style is only added to certain pages. You say in your question that your script … Read more