first time i am trying to include script to wordpress,but
after several hours reading wordpress codex and answers all over the web ,i still dont success to link the script to modernizr,
they both show in the head of the page as if they were registerd correctly but the script still ignores modernizr.
here is the code in function.php
function childtheme_script_manager() {
wp_register_script('new_service', get_template_directory_uri() .'/js/modernizr.custom.79639.js', array('jquery'), true, true);
wp_enqueue_script('new_service');
}
add_action('wp_enqueue_scripts', 'childtheme_script_manager');
function twentyfourteen_child_scripts() {
wp_enqueue_script('twentyfourteen_child_scripts', get_template_directory_uri().'/js/jquery.swatchbook.js');
}
add_action( 'wp_enqueue_scripts', 'twentyfourteen_child_scripts' );
I assume these are child theme scripts because of your function name:
When loading scripts from your child themes functions file you should use:
Or use
Another potential problem maybe the file names are invalid for some reason.
Applies to parent themes.