$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>jQuery for custom plugin not working with Divi theme|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

jQuery for custom plugin not working with Divi theme

matteradmin9PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far