Viewing 7 replies - 1 through 7 (of 7 total)
  • Moderator t-p

    (@t-p)

    try this:

    function jquery_register() {
    if ( !is_admin() ) {
    wp_deregister_script( 'jquery' );
    wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js');
    wp_enqueue_script( 'jquery' );
    }
    }
    add_action( 'init', 'jquery_register' );
    Thread Starter Teddy_c

    (@teddy_c)

    Thank you, unfortunately it does not work. Here is my website by the way

    https://www.thesofachronicle.com

    Also, the version of jQuery I am trying to implement is the 2.1.4 and not the 1.4

    Moderator t-p

    (@t-p)

    That snippet works, and why it does not work for you is hard to tell

    Thread Starter Teddy_c

    (@teddy_c)

    Everything worked perfectly before for me too. Ever since I check and uncheck this box in itheme security it stopped working

    Moderator t-p

    (@t-p)

    Have you checked with the “itheme” support?
    Ask if other people have similar complains, and if your theme is 4.2.4 compatible

    Thread Starter Teddy_c

    (@teddy_c)

    Problem fixed thanks to Dwiden. Please find his answer bellow:

    ——— Solution ———-

    Bug and you are using incorrect code in the functions.php file. If the Enqueue safe version of jQuery checkbox is still displayed and it is enabled please disable it and then click on the Save All Changes button.

    Then in the functions.php file of your child theme change your code to look like this (perhaps best to do a copy\paste):

    function mytheme_jquery_script() {
    	wp_deregister_script( 'jquery' );
    	wp_deregister_script( 'jquery-core' );
    
    	wp_register_script( 'jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js', array(), '2.1.4', false);
    	wp_enqueue_script( 'jquery' );
    }

    add_action( ‘wp_enqueue_scripts’, ‘mytheme_jquery_script’);
    If you already have a method\function being added as an action to the wp_enqueue_scripts hook in the theme functions.php file you can add all lines starting with wp_ at the end of that method\function. The rest is then obsolete (because it is probably already there).

    This should fix it.

    In the Enqueue safe version of jQuery setting click on the ‘click here to check again.’ link to obtain the JQuery version being used and then refresh the iTSec plugin Settings page. It should now report in green:

    Your current jQuery version is 2.1.4.

    If the above info helped you solve the issue please mark this topic as ‘resolved’.

    dwinden

    Moderator t-p

    (@t-p)

    Glad to know it ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Problem loading jQuery hosted library’ is closed to new replies.