scripts not enqueueing

I have been beating my head against this for a couple of hours now and can’t seem to figure it out. I am trying to enqueue a script into my page with the following code in my functions.php.

function my_slider_scripts() {
$scriptsrc = get_stylesheet_directory_uri().'/js/jquery.nivo.slider.pack.js';
wp_register_script( 'nivo-slider-pack', $scriptsrc );

    wp_enqueue_script('nivo-slider-pack');
} 

add_action( 'wp-enqueue_scripts', 'my_slider_scripts' );

I have looked at the codex and every tutorial I can find and nothing seems to make this work. I should mention I am using a child theme. Any ideas would be greatly appreciated.

3 Answers
3

try add_action('wp_enqueue_scripts', 'my_slider_scripts')

the hook doesn’t have a dash. It’s an underscore.

Leave a Comment