Reputation: 209
I run a personal wordpress website running the avada theme and I ran the google page speed insights tool on it and it said that I had an issue "Eliminate render-blocking JavaScript and CSS in above-the-fold content".
Im not sure how to go about correcting this, I dont know how to code wordpress themes so cant change the code. Ive tried using several plugin's to fix this and the the close one that came to nearly fixing it was "autoptimize". If anyone has any suggestions it would be greatly appreciated.
Upvotes: 0
Views: 3596
Reputation: 1173
Looks like there is a wordpress plugin called Above The Fold Optimization that will do a lot of the work for you. I believe it also enables compression. Once you install the plugin
Upvotes: 0
Reputation: 93
Take a look at wp_enqueue_script(). It allows you to specify where to echo the script, specifically the last argument $in_footer. If the script is echoed in footer after HTML is rendered, it will address your issue. Typically javascripts are called from functions.php file in your theme directory (wp-content/themes/your-theme-name/functions.php). Look for something like this:
wp_enqueue_script('isotope', get_bloginfo('template_url').'/js/jquery.isotope.min.js', array('jquery'), '1.3.110525', true);
it tells wordpress to enqueue the script with a dependency on jQuery and echo it in the footer. If you view the source of your web page, you can see which scripts are echoed in the header and which are in the footer. Some plugins will echo the scripts in the header regardless, so you can't do much without modifying the actual plugin. In addition some javascripts may require to be loaded at the top before DOM is loaded. Hope it helps.
Upvotes: 0