• Resolved chaseman

    (@chaseman)


    I’m trying to get jQuery on my local XAMPP installation to work with WordPress 3.1, but it seems it has no effect.

    This is what I do, I add this following code into the header shortly before the </head> tag:

    <?php
    	wp_enqueue_script( 'jquery' );
    	wp_enqueue_script('custom-jquery', get_bloginfo('stylesheet_directory') . '/js/custom-jquery.js', array('jquery'), '20110417' );
    
    	if ( is_singular() ) wp_enqueue_script('comment-reply');
    
    	wp_head(); 	?>

    And then I have this in the custom-jquery.js file:

    jQuery(function(){ /*<- shortcut for document ready*/
    jQuery(".post").css("background-color", "#ff6600");
    });//end docReady

    But nothing is happening, the background color does not change. I was able to get jQuery to work on a normal HMTL document on my localhost, but I’m not able to get it to work with WordPress.

    Any ideas what the cause for this problem is?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘jQuery is Showing No Effect’ is closed to new replies.