1

i dont seem to know what is wrong with my code in my functions.php file, I am using a child theme that i made based on the twentyten theme.

here is my code hopefully you guys can tell me whats wrong with it.

function style_n_scripts(){

wp_enqueue_script('jquery' );

    wp_register_script('style-js', get_template_directory_uri() . 'stylehercloset.js', array( 'jquery' ), NULL, false );
    wp_enqueue_script( 'style-js' );

}

add_action('wp_enqueue_scripts','style_n_scripts');

1 Answer 1

3

Add a slash before your name file.

wp_register_script('style-js', get_stylesheet_directory_uri() . '/stylehercloset.js', array( 'jquery' ), NULL, false );
Sign up to request clarification or add additional context in comments.

1 Comment

You are using a child theme, so you have to use get_stylesheet_directory_uri() instead of get_template_directory_uri().

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.