Tagged: enfold
-
AuthorPosts
-
June 18, 2020 at 5:27 pm #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 likeadd_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
June 19, 2020 at 3:29 pm #1224078Hi do you have any suggestion for the above topic? Thanks a lot
June 25, 2020 at 10:54 am #1225443Hi,
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,
IsmaelJune 25, 2020 at 11:45 am #1225456Thanks 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!
June 25, 2020 at 4:58 pm #1225595Hi elenapoliti,
Glad we could help :)
If you need further assistance please let us know.
Best regards,
Victoria -
AuthorPosts
- You must be logged in to reply to this topic.