admin管理员组文章数量:1130349
I'm writing a plugin, and it requires Bootstrap's nav tabs feature. I added Bootstrap to my plugin, and made sure jQuery was enqueued as well. This is how I did it:
function added_scripts () {
wp_enqueue_style( 'my-bootstrap-min-css', plugin_dir_url(__FILE__) . 'bootstrap/bootstrap.css');
wp_enqueue_script( 'my-bootstrap-min-js', plugin_dir_url(__FILE__) . 'bootstrap/bootstrap.js', array('jquery'), null, true);
}
add_action( 'wp_enqueue_scripts', 'added_scripts' );
It's working great with the TwentySeventeen theme and three other free theme I tried it with. However, it does not work with Elegant Themes' Divi theme. When I click on the tabs, nothing happens, which is exactly what was happening before I added jQuery.
I would have to think that there is an issue with Divi and the jQuery I'm adding, but I'm not sure what that would be, or how to find it. I don't get any console errors, either. Anyone have an idea of how I could solve this? It's on a local host build so I can't share a link, but I can share more code if needed. Thanks.
I'm writing a plugin, and it requires Bootstrap's nav tabs feature. I added Bootstrap to my plugin, and made sure jQuery was enqueued as well. This is how I did it:
function added_scripts () {
wp_enqueue_style( 'my-bootstrap-min-css', plugin_dir_url(__FILE__) . 'bootstrap/bootstrap.css');
wp_enqueue_script( 'my-bootstrap-min-js', plugin_dir_url(__FILE__) . 'bootstrap/bootstrap.js', array('jquery'), null, true);
}
add_action( 'wp_enqueue_scripts', 'added_scripts' );
It's working great with the TwentySeventeen theme and three other free theme I tried it with. However, it does not work with Elegant Themes' Divi theme. When I click on the tabs, nothing happens, which is exactly what was happening before I added jQuery.
I would have to think that there is an issue with Divi and the jQuery I'm adding, but I'm not sure what that would be, or how to find it. I don't get any console errors, either. Anyone have an idea of how I could solve this? It's on a local host build so I can't share a link, but I can share more code if needed. Thanks.
本文标签: jQuery for custom plugin not working with Divi theme
版权声明:本文标题:jQuery for custom plugin not working with Divi theme 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749216215a2334205.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论