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?
TomOctober 5, 2017 at 4:22 am #860384
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?
IsmaelOctober 5, 2017 at 1:33 pm #860581
I 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.
TomOctober 6, 2017 at 11:53 am #860958
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?
VictoriaOctober 6, 2017 at 2:42 pm #861033
Hi, I think there is a misunderstanding.
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:
<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' />
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?
TomOctober 7, 2017 at 3:57 am #861262
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.
You must be logged in to reply to this topic.