wp_enqueue_scripts – what am I doing wrong?
-
Please let me get a direct answer instead of “go find an example” or “you’re doing it wrong.” I know I’m doing it wrong, that’s why I’m asking.
So, this is what I have in my functions.php file
function mdg_setup_scripts() { $mdgtemplateloc = get_bloginfo( 'template_url' ).'/js/'; wp_register_script( 'hoverIntent', get_bloginfo('template_url').'/js/hoverIntent.js', array( 'jquery' )); wp_enqueue_script( 'hoverIntent' ); wp_register_script( 'mdMenuAnimation', $mdgtemplateloc.'mdMenuAnimation.js', array( 'hoverIntent' )); wp_enqueue_script( 'mdMenuAnimation' ); } add_action( 'wp_enqueue_scripts', 'mdg_setup_scripts' );
No <script> tag appears at all in the HTML generated.
Am I missing something I was supposed to put in the header.php to call this? What did I do wrong?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wp_enqueue_scripts – what am I doing wrong?’ is closed to new replies.