【发布时间】:2020-02-05 13:19:06
【问题描述】:
我是 wordpress 主题开发的新手。我正在开发一个主题,我使用了WP-Live Chat by 3CX
和 Contact Form 7 Multi-Step Forms 我的 wordpress 主题中的插件。我无法弄清楚实际问题。请帮助 - 我的问题是
适用于:3CX 的 WP-Live Chat
开始聊天按钮不起作用。出现这个问题是因为插件 js。我联系了他们的支持,他们还说插件 js 无法正常工作。我向他们展示了我的函数wp_enqueue_scripts 我是如何实现的。但他们说他们对此无能为力。
适用于:联系表 7 多步骤表单
第一步数据未显示在第二步表单中。我也联系了他们的支持,但他们也说这是 js 问题。
My website link
我无法弄清楚这些问题。我在functions.php 中加入了我的主题js 和css 喜欢
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');
这是因为我没有正确开发我的主题吗?如果不是那么可能是什么问题。请帮忙。
【问题讨论】:
-
控制台显示
onepress_js_settings未定义的错误。我不确定它是否与您的问题有关。该聊天的文档说明了如何集成它? -
我不知道在
consol onepress_js_settings中没有定义。它要么是一个变量,要么是一个函数。我没有足够的javascript知识。但我正试图找出答案。 -
嗯,实际上你需要它。在这种情况下,我建议您聘请其他人为您解决此问题。
-
感谢您的建议。我会先尝试解决这个问题,因为我想学习 js。如果我失败了,我会雇人。
-
如果你想学JS,那很好。对不起,如果我误解了你。您应该弄清楚应该在主题中设置
onepress_js_settings的位置。也许您应该尝试停用所有插件以查看此错误是否消失。在主题中出现 JS 冲突是很常见的。
标签: javascript wordpress plugins wordpress-theming