I’m developing a theme and trying to get wp_enqueue_script to work. The curious thing, is that nothing shows up. It doesn’t do anything. Here’s my setup:
in functions.php I have:
function named_scripts() {
global $named_options;
if( is_admin() ) return;
wp_deregister_script( 'jquery' );
wp_register_script( 'screen', tz_JS . '/screen.js', array( 'jquery' ) );
wp_enqueue_script( 'screen' );
wp_enqueue_script( 'bootstrap', tz_JS . '/bootstrap/bootstrap.js', array( 'jquery' ) );
wp_register_style( 'custom-style', get_template_directory_uri() . '/css/custom-style.css', array(), '20120208', 'all' );
wp_enqueue_style( 'custom-style' );
}
add_action( 'init', 'named_scripts' );
in header.php I call
named_scripts();
And in the HTML, nothing shows up at all.
You should have registered your jquery file after remove the default wordpress jquery. I use this code.. hope it helps..