i'm enqueuing jQuery with wp_enqueue_script( 'jquery' );

(i see

<script type='text/javascript' src='http://localhost/wp/wp-includes/js/jquery/jquery.js?ver=1.10.2'></script>
<script type='text/javascript' src='http://localhost/wp/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>

in the resulting html page)

now, i'm tryin to use:

$(document).ready(function() {
    $('#showmenu').click(function() {

and it only works if i add a jQuery reference manually (<script src="//code.jquery.com/jquery-1.10.2.js"></script>)

do i miss something?


Try this:

jQuery(document).ready(function() {
    jQuery('#showmenu').click(function() {

Wordpress hates the $ statement. If you replace it with jQuery, it should work.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.