I don't know what is the reason that WP is not accepting the standard embedding technique from jquery website ( http://learn.jquery.com/about-jquery/how-jquery-works/ ):

<!doctype html>
    <meta charset="utf-8" />
    <a href="http://jquery.com/">jQuery</a>
    <script src="jquery.js"></script>

    $( document ).ready(function() {
        $( "a" ).click(function( event ) {
            alert( "The link will no longer take you to jquery.com" );


And allowing you only to wp_register_script your scripts in the functions.php or in the header.

I want be able to embed the jQuery the way it is supposed to be and where I want in my template files.

So, the question is how can I enable the standard embeding recognition of jquery code in WP?

If that's not possible, is there a plugin for that or what files do I need to hack in WP core, if that's not possible to solve by some hook?

  • This is a duplicate of your previous question. Please review the answers given to that question, as correct implementation of script enqueueing will make this question moot. Oct 2, 2013 at 13:16
  • What's supposed to be is generally up for debate, in this case and in general... Here you should just use the possibility to enqueue your scripts conditionally, you find all the information you need for that on WPSE. Oct 2, 2013 at 13:21


Browse other questions tagged or ask your own question.