简体   繁体   中英

Plugin Javascript(maybe ajax) is not working in my wordpress custom theme

I am new in wordpress theme development. I am developing a theme and I used WP-Live Chat by 3CX and Contact Form 7 Multi-Step Forms plugins in my wordpress theme. I can't figure out the actual issues. Please help- my issues are

For: WP-Live Chat by 3CX

在此处输入图片说明

The start chat button not working. This problem happens because of the plugin js. I contacted their support they also said plugin js not working properly. I showed them my functions wp_enqueue_scripts how I implemented. But they said they can't help more about this.

For: Contact Form 7 Multi-Step Forms

The first step data is not showing in the second step form. I contacted their support also but they also said this is js problem. 在此处输入图片说明 在此处输入图片说明

My website link I can't figure out the issues. I included my theme js and css in functions.php like

function themename_scripts() {
    wp_enqueue_script('othemename-jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js', array(), null, true);
    wp_enqueue_style('themename-animate', get_template_directory_uri() . '/assets/css/animate.min.css', false, '1.1', 'all');
    wp_enqueue_style('themename-fontawesome', get_template_directory_uri() . '/assets/css/font-awesome.min1849.css', false, '1.1', 'all');
    wp_enqueue_style('themename-bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css', false, '1.1', 'all');
    wp_register_style('othemename-owlcarousel', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.3/assets/owl.carousel.min.css');
    wp_enqueue_style('othemename-owlcarousel');
    wp_register_style('othemename-owlcarousel-theme', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.3/assets/owl.theme.default.min.css');
    wp_enqueue_style('othemename-owlcarousel-theme');
    wp_enqueue_style('themename-style', get_stylesheet_uri());

    wp_enqueue_script('othemename-owlcarouseljs', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.3/owl.carousel.min.js', array(), null, true);
    wp_enqueue_script('themename-jquerymigrate', get_template_directory_uri() . '/assets/js/jquery/jquery-migrate.min330a.js', array(), '20151215', true);
    wp_enqueue_script('themename-bootstrap', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array(), '20151215', true);
    wp_enqueue_script('themename-theme', get_template_directory_uri() . '/assets/js/themeac31.js', array(), '20151215', true);
    wp_enqueue_script('themename-extra', get_template_directory_uri() . '/assets/js/extra.js', array(), '20151215', true);

    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
}
add_action('wp_enqueue_scripts', 'themename_scripts');

Is this because of I am not properly developing my theme? If not then what could be the problem. Please help.

👋 Hello world,

I believe I resolved the same (or similar) issue with the OnePress WP Theme just now by updating the jQuery version in use.

It appears the original question asker has updated the chat script on their website to Tawk.to since posting the question, and Tawk.to's chat is functioning fine as far as I can tell.

👉 Do you need further help with the issue?

If so, please continue reading for more information on how I found this post and what I used to resolve.

I found the same 🛑 "onepress_js_settings is not defined" error message mentioned in the comments under the question in the Developer Tools Console tab of Chrome.

We also have 💬 Tawk.to active on the site I just fixed it on as it happens.

After an overnight WP auto-update, his site ran into some Jquery conflicts producing the "OnePress" theme error message.

🤔 Why did I try a jQuery Update?

I found a thread on WordPress.com where someone else had the same error message. Their thought was that Bootstrap 4.0 required a newer version of jQuery than was in use.

Here is the 📰 article I found for reference: https://wordpress.org/support/topic/not-compatible-with-bootstrap-4-not-load-jquery-3/

Additionally, here is a link 🔗 to the free plugin that fixed the problem by updating the jQuery version for me by simply installing and activating it: https://wordpress.org/plugins/jquery-updater/

Hope that helps 🤞 anyone else who finds this post and maybe the asker as well since you mentioned wanting to learn more about JavaScript, and in this instance, I believe jQuery specifically.

Cheers & thanks for reading. 🙏 Sean Sr. 🤵

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM