esedic
4/1/2020 - 6:14 PM

Load script in Wordpress after jQuery

Load script in Wordpress after jQuery

function load_my_script(){
    wp_register_script( 
        'my_script', 
        get_template_directory_uri() . '/js/myscript.js', 
        array( 'jquery' )
    );
    wp_enqueue_script( 'my_script' );
}
add_action('wp_enqueue_scripts', 'load_my_script');