milohuang / reverie

Reverie is a versatile HTML5 responsive WordPress framework based on ZURB's Foundation.
http://theakiba.com/reverie/
MIT License
916 stars 196 forks source link

Registering jQuery-noConflict.js should be using get_template_directory_uri, no? #176

Closed gorelog closed 11 years ago

gorelog commented 11 years ago

I just started setting up a child theme and ran into a 404 error with jQuery-noConflict.js. It was looking for this file within my child theme. So to reduce the need for redundant files should this not be using get_template_directory_uri like the other files?

clean.php line 125 Original

wp_register_script( 'jquery-noconflict', get_stylesheet_directory_uri() . '/js/jQuery-noConflict.js', array('jquery'), '1.0', true );

Updated

wp_register_script( 'jquery-noconflict', get_template_directory_uri() . '/js/jQuery-noConflict.js', array('jquery'), '1.0', true );

You can also just deregister and register it in it's proper place in your child theme functions.php like so:

function mychildtheme_js() {
    if ( !is_admin() ) {
        wp_deregister_script( 'jquery-noconflict' );
        // Load from parent theme
            wp_register_script( 'jquery-noconflict', get_template_directory_uri() . '/js/jQuery-noConflict.js', array('jquery'), '1.0', true );
        wp_enqueue_script( 'jquery-noconflict' );
    }
}
add_action( 'wp_enqueue_scripts', 'mychildtheme_js' );
milohuang commented 11 years ago

Updated early this morning. Check it out.