Enqueuing Script with async

Hey,
I am enqueuing some script and style in my functions.php like this:
wp_enqueue_script(‘flove_main_js’, ‘/wp-content/themes/pro-child/main.js’, [‘jquery’]);
My question is: How can I load a script or style like this async or defer?
Thanks!

Hey @awecesar,

Regretfully, there is no feature in X / Pro that could achieve what you need. Here are some articles that might help you with that.

https://wordpress.org/ideas/topic/non-blocking-asynchronous-wp_enqueue_script

https://www.wpfaster.org/code/how-to-defer-or-async-javascript-without-a-plugin

Hope that helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.