Tagged: 

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1223824

    Hello I have a single page which is loaded with a custom template. In this page I barely use enfold elements, apart for some text and a title. However I had to load a series of custom scripts that are saved in various files, as the page contains an interactive map based on OpenLayers. Furthermore, on the map a certain amount of geojson files are loaded.
    At the end the page is loading a huge amount of scripts. I would like to make it lighter by deregister standard enfold scripts that I don’t use there and by dequeue css files that are not needed there.
    I imagine that the code for js for example can be something like

    add_action( 'wp_enqueue_scripts', 'deregister_java_enfold', 100 );
    
    function deregister_java_enfold() {
       if ( is_page('1771') ) {
        wp_deregister_script( 'avia-lightbox-activation' );
        wp_deregister_script( 'avia-widget-js' );
        wp_deregister_script( 'avia-megamenu' );
       //etc
         }
    }

    I can see from my page source all the list of not needed files but I don’t know which is the shortname I should use it. Or which is the best way to do it.
    The same is with css.

    Thanks for help

    #1224078

    Hi do you have any suggestion for the above topic? Thanks a lot

    #1225443

    Hi,

    Thank you for the inquiry.

    Have you tried setting the Enfold > Performance > Disabling of template builder elements to the second option (Load only used elements)? How do you load the builder or enfold elements in the custom template?

    You can find most of the scripts and their name in the functions.php, inside the avia_register_frontend_scripts function.

    Best regards,
    Ismael

    #1225456

    Thanks Ismael. usually I manually disable the template builder elements as in the past the “Load only used elements” options was crashing some pages. However I tried it now and its works. Still there are a few css / scripts that I don’t need on this specific page, but thanks for pointing out where I can find those!

    #1225595

    Hi elenapoliti,

    Glad we could help :)

    If you need further assistance please let us know.
    Best regards,
    Victoria

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.