• Resolved bigi879

    (@bigi879)


    function load_cdn_func() {
    		wp_deregister_script('jquery');
    		wp_enqueue_script('my-jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js', array(), '1.11.1');
    }
    add_action('wp_enqueue_scripts', 'load_cdn_func');

    I wrote the code on functions.php.
    But “http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js” wasn’t read.

    add_action(‘wp_enqueue_scripts’, ‘load_cdn_func’);
    ↓  ↓
    add_action(‘init’, ‘load_cdn_func’);
    I changed like this, It’s OK.

    Please teach me.

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘wp_enqueue_scripts dosen't work’ is closed to new replies.