Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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,
    Tom

    #860384

    Hey 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,
    Ismael

    #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.
    Best,
    Tom

    #860958

    Hi 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,
    Victoria

    #861033

    Hi, 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,
    Tom

    #861262

    Hi,

    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_style

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.