jQuery for custom plugin not working with Divi theme

admin2025-06-06  8

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.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749216263a317336.html

最新回复(0)