Last active
July 20, 2020 19:07
-
-
Save vikastyagi87/cf82ee676711df90b6e355711b370ebd to your computer and use it in GitHub Desktop.
Add Custom JavaScript to Your WordPress Site
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Load JavaScript file for front end from child theme | |
function my_scripts_method() { | |
wp_enqueue_script('custom-script', get_stylesheet_directory_uri() . '/js/custom-script.js', array( 'jquery' ) | |
); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_scripts_method' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment