WordPress.org

Ready to get started?Download WordPress

Forums

Variable in wp_register_script doesn't work (1 post)

  1. John Peden
    Member
    Posted 2 years ago #

    Hi,

    Using:
    wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js');

    jquery.js is loaded. However, as I'm using the URL elsewhere in my code, I'd like to load it this way, which doesn't work:

    $jquery_url = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.js'; //jQuery URL
    ...
    wp_register_script( 'jquery', $jquery_url);

    Am I missing something?

    Thanks

    John

Topic Closed

This topic has been closed to new replies.

About this Topic