• Resolved alainsch

    (@alainsch)


    After update Hello Theme to version 3.0.0 all custom code in the site using jQuery stops working properly. Specially in Apple devices and Safari. Also, various plugins that use jQuery code not working properly too. After downgrade the Hello Theme to previous version 2.9.0 everything was back to normal.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello Theme?doesn’t load jQuery because the theme doesn’t use jQuery anymore.

    The various plugins you mention, which use jQuery and don’t work properly, they should set jQuery as a dependency, not the theme.

    If you use custom jQuery code on your website, you need to set jQuery as a dependency for this code.

    The theme shouldn’t load jQuery for millions of websites if it’s not in use. If your website needs jQuery, you need to load the script on your specific website.

    Use the following code to load jQuery in your projects:

    function custom_theme_scripts() {
      wp_enqueue_script( 'my-script', get_template_directory_uri() . '/js/my-script.js', [ 'jquery' ], '1.0.0', true );
    }
    add_action( 'wp_enqueue_scripts', 'custom_theme_scripts' );
    Thread Starter alainsch

    (@alainsch)

    Thanks Rami for the clarification, I was struggling to find a simple solution to load jQuery again in the theme and don’t need worry about the custom codes and the plugin.
    I use this code that I found in other thread and works for me:

    function load_scripts(){
        wp_enqueue_script('jquery'); # Loading the WordPress bundled jQuery version.
    }
    add_action('wp_enqueue_scripts', 'load_scripts');
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hello Theme 3.0 update breaks jQuery custom codes and plugins functionality’ is closed to new replies.