Created
April 5, 2022 16:14
-
-
Save TarttWeb/69141f6cb6f38a609dfbcd7edff72a2d to your computer and use it in GitHub Desktop.
WordPress Load Custom JavaScript File Example
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
<?php | |
function load_custom_script(){ | |
wp_register_script( 'custom-js', custom.js', false ); | |
wp_enqueue_script( 'custom-js' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'load_custom_script' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment