Adding Custom Javascript to Skeleton Child Theme

One problem: if you define the script in a wp_register_script() like so:

wp_register_script( 
    'jquery.imagemapster.js', 
    get_template_directory_uri() . '/javascripts/jquery.imagemapster.js', 
    array('jquery'), 
    '1.2.6', 
    false 
);

…then you only need to reference the defined script’s name in the wp_enqueue_script() call, like so:

wp_enqueue_script( 'jquery.imagemapster.js' );

Re-declaring all of the parameters in wp_enqueue_script() shouldn’t cause the fatal error you describe; however, it could cause unintended consequences (especially if the declarations do not match between wp_register_script() and wp_enqueue_script()).

Leave a Comment

tech