Reply To: Defer loading of javascript

Home Forums Main Forum Theme Suggestion Box Defer loading of javascript Reply To: Defer loading of javascript

#22909
Sushil Adhikari
Moderator

Hi there,

Thanks for illustrating issue on details. All our .js are loaded on footer area which means js are loaded after the page loads. You can see the screenshot attached.

And there is some text that are loaded outside the footer area. It also includes js from google analytics plugin. There is some js on theme that are loaded ourside the footer area. To load them on footer you can use this concept.

wp_enqueue_script( 'puresimple-jquery-ui', get_template_directory_uri() . '/js/jquery-ui.js', array( 'jquery' )); 

In the above code if add argument true at last it will load that particular js on footer for an example:

wp_enqueue_script( 'puresimple-jquery-ui', get_template_directory_uri() . '/js/jquery-ui.js', array( 'jquery' ), true);

Note: Please follow the process only if you are technically sound on WordP1ress.

Thanks
nedi-screenshot.jpg

Attachments:
You must be logged in to view attached files.