Move Jquery.js to Footer

When you deregister jQuery, you have to register it again. Try this code UPDATE: You have to deregister jQuery first (first part of your code), so the final code should be: //Load on Footer add_action(‘wp_enqueue_scripts’, ‘register_jquery’); function register_jquery() { wp_deregister_script(‘jquery’); // remove original jQuery wp_register_script( // add custom jQuery in footer ‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js’, array(), // … Read more

Retrieve Woocommerce Cart Url with javascript/jquery [closed]

You can pass it to the script via the functions.php file or a plugin using the wp_localize_script function. <?php function my_load_scripts() { wp_enqueue_script(‘my-script’, plugin_dir_url( __FILE__ ) . ‘js/my-script.js’); wp_localize_script(‘my-script’, ‘my_script_vars’, array( ‘woo_cart_url’ => get_permalink( wc_get_page_id( ‘cart’ ) ) ) ); } add_action(‘wp_enqueue_scripts’, ‘my_load_scripts’); Then it will be available in your script ( in the example: … Read more

Homepage loads many unnecessary jquery-ui files

I can not explain this but this seems to be solved. Using Autoptimize already but now aggregating javascript in stead of minify did the job. I could not do this before because it made Contact Form 7 fail to redirect to a “thank you” page after sending a form. With the help of the author … Read more