an
groups-icon

Page Load Speed Increase

Wait a minute... This content is very very old. We no longer sell or support this theme version. New Topics
  • Version 9
    Stephen sproffitt@thecouponoasis.com
    0 points
    Beginner

    Are you looking to add a boost to your CP page load speed? We added this little bit of code to our functions.php file in the CP directory.


    // Defer Javascripts
    // Defer jQuery Parsing using the HTML5 defer property
    if (!(is_admin() )) {
    function defer_parsing_of_js ( $url ) {
    if ( FALSE === strpos( $url, '.js' ) ) return $url;
    if ( strpos( $url, 'jquery.js' ) ) return $url;
    // return "$url' defer ";
    return "$url' defer onload='";
    }
    add_filter( 'clean_url', 'defer_parsing_of_js', 11, 1 );
    }

    This code may cause problems for some plugins, most notably LayerSlider if you are using it. But so far with the plugins we are using we’ve had no trouble. If it doesn’t work for you, then just remove it from your functions.php file and re-save.

    Hope it helps.

    Stephen

    November 30, 2016 at 7:03 am

451

Views

0

Replies