javascript - How to include more then one JS in wordpress theme? -
javascript - How to include more then one JS in wordpress theme? -
i trying add together 2 js files in website theme:
js/jscripts.js js/bootstrap-hover-dropdown.jsthe code using:
function wptuts_scripts_with_jquery() { // register script plugin: wp_register_script( 'custom-script', plugins_url( '/js/custom-script.js', __file__ ), array( 'jquery' ) ); // or // register script theme: wp_register_script( 'custom-script', get_template_directory_uri() . '/js/custom-script.js', array( 'jquery' ) ); // either plugin or theme, can enqueue script: wp_enqueue_script( 'custom-script' ); } add_action( 'wp_enqueue_scripts', 'wptuts_scripts_with_jquery' );
by usnig function can add together 1 js file, how can add together 2nd js file. new wordpress , php. need help!! :)
function wptuts_scripts_with_jquery() { // plugin js wp_register_script( 'custom-script', plugins_url( '/js/jscripts.js', __file__ ), array( 'jquery' ) ); wp_register_script( 'drop-down', plugins_url( '/js/bootstrap-hover-dropdown.js', __file__ ), array( 'jquery' ) ); // or theme js wp_register_script( 'custom-script', get_template_directory_uri() . '/js/jscripts.js', array( 'jquery' ) ); wp_register_script( 'drop-down', get_template_directory_uri() . '/js/bootstrap-hover-dropdown.js', array( 'jquery' ) ); wp_enqueue_script( 'custom-script' ); wp_enqueue_script( 'drop-down' ); } add_action( 'wp_enqueue_scripts', 'wptuts_scripts_with_jquery' );
javascript php jquery wordpress
Comments
Post a Comment