enqueue wp JS
-
having difficulties to load JS in enqeue, can someone guide me?
Did loaded two JS files In /childtheme/js/
zxcvbn.min.js
password-strength-meter.jsI know I have to change theme_name to my theme name
What else?
function theme_name_scripts() {
wp_enqueue_style( ‘style-name’, get_stylesheet_uri() );
wp_enqueue_script( ‘script-name’, get_template_directory_uri() . ‘/js/zxcvbn.min.js’, array(), ‘1.0.0’, true );
wp_enqueue_script( ‘script-name’, get_template_directory_uri() . ‘/js/password-strength-meter.js, array(), ‘1.0.0’, true );
}add_action( ‘wp_enqueue_scripts’, ‘theme_name_scripts’ );
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘enqueue wp JS’ is closed to new replies.