Add script to wordpress front end:

function my_custom_scripts() {
wp_enqueue_style( 'style-name', get_template_directory_uri() . '/dropzone/dropzone.css' );
wp_enqueue_script( 'script-name', get_template_directory_uri() . '/dropzone/dropzone.js' );
}

add_action( 'wp_enqueue_scripts', 'my_custom_scripts' );

Add script to wordpress admin:

add_action( 'admin_enqueue_scripts', 'admin_enqueue_js' );

function admin_enqueue_js(){
wp_enqueue_script( 'my_custom_script', plugin_dir_url( __FILE__ ) . 'myscript.js' );
}

Ref:- wp_enqueue_script

or add script to template/theme’s header.php file

 <script src="<?php echo get_bloginfo('template_directory'); ?>/dropzone/dropzone.js"></script>
Advertisements