Hi, can someone tell me why this code doesn't work? The is_page() is not in effect.
function tao_scripts() {
if (!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery', get_template_directory_uri() . '/js/jquery-1.4.2.min.js', false, '1.4.2');
wp_enqueue_script('jquery');
if ( is_page() ) {
wp_register_script('jquery-validate', get_template_directory_uri() . '/js/jquery.validate.min.js', 'jquery', '1.7');
wp_enqueue_script('jquery-validate');
}
}
}
add_action('init', 'tao_scripts');
The code is in a php file which is included i my functions.php.
I have tried all I could find/think of. Without the is_page() conditional it works. I have tried with wp_reset_query(), no help. Im sure wordpress knows its a page. is_page(34, 'name', 'Name') wont help either.