I know that wp_enqueue_script() inserts Javascript files into the WordPress header in the appropriate place.
However, I want to include my Javascript in all single posts, ignoring the WordPress home or blog page.
Is that possible at all?
I tried this:
<?php
function my_scripts_method() {
if ( is_single() ) {
wp_deregister_script( 'jquery' );
wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
wp_enqueue_script( 'jquery' );
}
}
add_action('wp_enqueue_scripts', 'my_scripts_method');
?>
But it's not working...