Support » Plugin: W3 Total Cache » How to Remove render-blocking JavaScript

Viewing 1 replies (of 1 total)
  • More than likely it is due to jQuery refusing to be placed in the footer…assuming you’ve told w3tc to put your js files into your footer.

    If you’re comfy looking at code you can place this inside your theme’s functions.php file which tells wp to move jquery to the footer:

    
    function my_scripts()
    {
      // Move jQuery to the footer (jQuery depends on jquery-core and jquery migrate)
      wp_scripts()->add_data( 'jquery', 'group', 1 );
      wp_scripts()->add_data( 'jquery-core', 'group', 1 );
      @wp_scripts()->add_data( 'jquery-migrate', 'group', 1 );
    }
    add_action( 'wp_enqueue_scripts', 'my_scripts', 99 );
    
Viewing 1 replies (of 1 total)
  • The topic ‘How to Remove render-blocking JavaScript’ is closed to new replies.