![]() ![]() ![]() We can do this by invoking the all_deps method on the WP_Scripts object ( $wp_scripts->all_deps($wp_scripts->queue) ) Sort the javascript file handles according to its dependency, so that the merged file(later) can run without any errors.To be able to combine all javascript files into one file, we must know javascript files that can be detected automatically before our web content displayed.įor this purpose, we can use the wp_enqueue_scripts hook, although this hook has some weaknesses (described later), at least this is the only trick we can use.įurthermore, to combine javascript files into one file, the necessary steps are: Appear on the bottom, after the footerĬombining javascript files into one file in WordPress ![]() You can try this by opening the functions.php file located in the theme folder that is being used. WordPress run this hook right before the closing tag.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |