Tagged: selector
-
AuthorPosts
-
October 14, 2020 at 11:16 am #1252740
Hello. I would like to replace the standard Enfold Lightbox with the Meow Lightbox plugin. I am a photograher and this Meow pluging let me show all the EXIF-data. I built a new site from scratch, without any other plugins. This Meow plugin works standard out-of-the-box when not using the Enfold theme. In the Enfod theme I disabled the option ‘Lightbox modal’ in the hope that the Meow plugin takes the action over and opens the lightbox of this plugin. But no, all what happens is, that a the page is replaced with the picture…but without the lightbox options (arrow, etc). The Meow plugin is NOT triggered!
The Meow pluging needs a ‘selector’ to activate the Meow ligtbox when using a not-standard theme.
For now, I use the following selectors without any succes:av_gallery, av_masonry_entries, .avia_gallery, .entry-content, .gallery, .mgl-gallery, .wp-block-gallery
So I have two questions:
– Why is the Enfold lightbox not completely disabled when I disable this in the Enfold theme options and what should I do to completetly disable it
– what selector should I use to trigger the Meow lightbox plugin so that this lightbox will open and not the ‘diabled’ Enfold’ lightboxWhen I make in Gutenberg blocks make a code and import it as code in the ALB the Meow plugin works fine. But I hate the Gutenberg blocks…
Thanks for your time
HenriOctober 18, 2020 at 5:03 pm #1253619Hey flipper1960,
Sorry for the late reply, and thanks for the login and test page, so I have not used the Meow Lightbox plugin before so in my research I found the plugin was giving the same error as reported here to the plugin author, the solution for this error is to remove this from the “lightbox.js” script:
//# sourceMappingURL=lightbox.js.map
This may have not been necessary, but I wanted to rule it out. Anyways, I wanted to isolate the behavior of the Meow plugin & the Magnific Popup lightbox which is the default lightbox, typically other lightbox scripts use a similar script for the lightbox. So I first tried using the “exclude” function in the Magnific Popup lightbox, which is in the file\wp-content\themes\enfold\js\avia-snippet-lightbox.js
on line 211, with the lightbox option in the theme set to disabled, but with this setting the Meow Lightbox plugin fires first and loads, but then is redirected to the image file. If you watch very closely you will see that the plugin is working but I believe the Magnific Popup lightbox is embedded deeper than it seems.
So as a workaround, I enabled the Magnific Popup lightbox in the theme options and added this script in your functions.php file:function custom_script(){ ?> <script> (function($){ $('body').on("click", ".lightbox", function () { setTimeout(function(){ $('button.mfp-close').trigger('click'); }, 200); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script');
I also replaced your Meow Lightbox plugin “Selector” classes with “.avia-gallery a” to target this one element, I understand you want to add more, but if we can get this one element to work first then we can move forward on the other elements.
So now on your test page, the “avia-gallery” is working for the Meow Lightbox plugin, please clear your browser cache and check.Best regards,
MikeOctober 18, 2020 at 5:52 pm #1253629Hello Mike,
Thanks very much! It works like I would like it to work. Great.
I have also inserted now an av_mansonry_gallery .
What should I do to let it work like the av_gallery?
Hope you can tell me
Thanks in advance for your great support!
Henri (flipper1960)October 18, 2020 at 6:27 pm #1253649Hi,
For the masonry element the class seems to be.av-masonry-image-container
, I adjusted, please check.Best regards,
MikeOctober 18, 2020 at 9:01 pm #1253701Hello Mike (?)
Works like a charm! Many thanks.
I transferred my production site to my testsite now
I will give you new crendentials in the private content.The only thing that goes wrong is: please open a gallery and watch the first photo ( the birds on http://henridolfing.online/portfolio-item/groningen-ommeland-roegwold/) . Then go two or more photos to the right in the gallery. Now you close the actual photo that is on the screen with the cross in the right upper corner. The photo will close,(that is the Meow lightbox) but the first openend photo in the gallery (with the birds) is still visible and also needs to be closed.(is the Enfold lightbox).
Have you any idea to fix this, so ! close all the photos with one click?.
Thanks again
HenriOctober 18, 2020 at 9:23 pm #1253708Hi,
Thanks for the login, I adjusted the script to this:function custom_script(){ ?> <script> (function($){ $('body').on("click", ".lightbox,.lightbox-added", function () { setTimeout(function(){ $('button.mfp-close').trigger('click'); }, 200); }); })(jQuery); </script> <?php } add_action('wp_footer', 'custom_script');
please check.
Best regards,
MikeOctober 18, 2020 at 10:15 pm #1253713Hello Mike.
Works 100% now!
Thank you very much and thaqnk for your support!Henri
October 18, 2020 at 10:17 pm #1253714Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Meow lightbox replacing the Enfold lightbox?’ is closed to new replies.