Tagged: Lightbox, Magnific popup
-
AuthorPosts
-
October 3, 2017 at 11:47 am #859590
Hi, I’m not using enfold’s built in lightbox (because it’s old and outdated…), so I unchecked “Lightbox Modal Window” in Enfold’s settings, and implemented another lightbox.
Looking at the source code though, I still see that the theme loads the css and JS files to magnific popup, but I don’t think these are needed anymore.
Are they still there for a purpose, or did you just forget to disable them and I can dequeue them?
Thanks,
TomOctober 5, 2017 at 4:22 am #860384Hey Tom,
Thank you for using Enfold.
If you disabled the theme’s lightbox, you can dequeue the lightbox script because it’s not needed. What is the name of the current lightbox that you’re using?
Best regards,
IsmaelOctober 5, 2017 at 1:33 pm #860581I am using photoswipe, it’s mobile and touch friendly, unlike magnific.
I will dequeue magnific, but I don’t think the magnific CSS and JS should even be loaded once your default lightbox is disabled. Will you fix this in the next release? If yes, than I won’t dequeue now.
Best,
TomOctober 6, 2017 at 11:53 am #860958Hi Tom,
It’s there in the folder, what do you mean loaded, like you have a call to load the script? Could you please give us a link to your website, we need more context to be able to help you?
Best regards,
VictoriaOctober 6, 2017 at 2:42 pm #861033Hi, I think there is a misunderstanding.
In short:
1. Enfold uses the Magnific lightbox as it’s built in lightbox script.
2. When someone unchecks the “Lightbox Modal Window” in Enfold’s settings, the JS and CSS to Magnific lightbox should not be enqueued by Enfold, since they are not being used any more.The problem is that the script is still being enqueued by Enfold, using resources unnecessarily.
So if you look at the source code for koltsokosan.hu, you can see the JS and CSS of Magnific loading, despite the fact that it should be turned off:
Line 62:
<link rel='stylesheet' id='avia-popup-css-css' href='https://koltsokosan.hu/wp-content/themes/enfold/js/aviapopup/magnific-popup.css?ver=4.1' type='text/css' media='screen' />
Line 525:
<script type='text/javascript' src='https://koltsokosan.hu/wp-content/themes/enfold/js/aviapopup/jquery.magnific-popup.min.js?ver=4.1'></script>
Do you understand now?
The Magnific lightbox CSS and JS files should not be loading at all, if it’s turned off from Enfold’s settings.
Will you fix this in the next release?
Thanks,
TomOctober 7, 2017 at 3:57 am #861262Hi,
Yes, that’s correct. We’ll report the issue. For the meantime, you can remove it by using the following functions in the child theme’s functions.php file.
// https://codex.wordpress.org/Function_Reference/wp_dequeue_script
// https://codex.wordpress.org/Function_Reference/wp_deregister_styleBest regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.