0

Ive tried a lot of versions of doing this I have found on SO and the net but none have worked for me.

I am running version 3.4.2. Perhaps there is a different way of doing it for this version?

My code is:

<?php
function my_scripts_method() {
  wp_enqueue_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js' );
  wp_enqueue_script( 'jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js' );

}

add_action( 'wp_enqueue_scripts', 'my_scripts_method' );
?>

I have this just above the </head> tag.

Can anyone help me out and tell me where I am going wrong?

4
  • you can always include it directly without these wrapper functions Commented Jun 20, 2013 at 4:39
  • @DevZer0 Thanks - I did try that too. No luck Commented Jun 20, 2013 at 4:49
  • then your placing it in the wrong header file, make sure the header file you choose is for the one of the current theme. Commented Jun 20, 2013 at 4:59
  • Try putting it inside functions.php in the current theme directory. Commented Jun 20, 2013 at 8:58

1 Answer 1

1

Had similiar issue and I fixed it first deregister, register it to your value and than enqueue

At http://codex.wordpress.org/Function_Reference/wp_register_script

If you try to register or enqueue an already registered handle with different parameters, the new parameters will be ignored. Instead, use wp_deregister_script() and register the script again with the new parameters.

wp_deregister_script('jquery');
wp_register_script('jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js');
wp_enqueue_script('jquery');

wp_deregister_script('jquery');
wp_register_script('jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js');
wp_enqueue_script('jquery');
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.