The wp_enqueue_script() function doesn’t support async/defer by itself, but luckily the script_loader_tag hook allows us to manipulate the wp_enqueue_script() output really easily. If you need more info on why and when to use async/defer, you can read this article. In this document, you will learn the necessary functions for generating the proper URL to point to asset files and how to include scripts, styles, and other assets in your theme. To add defer / async to enqueued script with id fontawesome5. If you’ve never heard about the wp_enqueue_script() before, please read this article before proceeding. How to add defer / async in wpenqueuescript. To be able to understand this article you need to understand how wp_enqueue_script() function works.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |