Blog

Use WP Enqueue Script To Properly Add Javascript Files To WordPress

Use WP Enqueue Script To Properly Add Javascript Files To WordPress

Paste the code below into your functions.php file. Then, replace PATH TO JS FILE with the absolute or relative URL to the Javascript or jQuery file you want to include. function enqueue_my_custom_script() { wp_enqueue_script( ‘my-custom-js’, ‘PATH TO JS FILE’, false ); } add_action( ‘wp_enqueue_scripts’, ‘enqueue_my_custom_script’ );