Issue between Envira, Bootstrap and jQuery
-
I’m using WP 4.9.1, Envira Lite 1.6.2 and Bootstrap 4.0.0 Beta 2.
The URL in question: https://www.finedining.dreamhosters.comThis is the situation:
– When NO jQuery is manually loaded, Envira gallery works perfectly but Bootstrap functionality that requires jQuery does not (such as the Navbar-Toggler button used to show Mobile menu).
– If I deregister, register and enqueue jQuery via functions.php file, Bootstrap works but Envira does not (properly) work: It can open an image via Lightbox but there are no controls for swiping or exiting the images/lightbox. It becomes impossible to exit the lightbox without refreshing the whole page.
This is the code:
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11); function my_jquery_enqueue() { wp_deregister_script('jquery'); wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js", false, null); wp_enqueue_script('jquery'); }
Interestingly, if I use older jQuery 1.7.1 (same code as above) Envira works but Bootstrap becomes buggy (I can expand the navbar in mobile but not collapse it).
I’ve also tried to enqueue WP’s default jQuery with the following code:
function insert_jquery(){ wp_enqueue_script('jquery'); } add_filter('wp_head','insert_jquery');
In this case Envira works but Bootstrap’ JS functionality again does not.
I really like Envira gallery and I’d like to continue using it (possible upgrade) but I need help with this.
The page I need help with: [log in to see the link]
- The topic ‘Issue between Envira, Bootstrap and jQuery’ is closed to new replies.