Reduce HTTP Calls…
-
Just wondered if you could make a suggestion.
I am trying to decrease the page loading time of my daughters WordPress website by minimizing HTTP requests. Therefore, I am only loading css and js files on a per page basis.
In reviewing your wp-forecast.php file I found:
add_action(‘wp_enqueue_scripts’, ‘wp_forecast_css’);So I wrote the following code for the functions.php file
function wpcustom_deregister_scripts_and_styles(){
if (is_page(array(‘about’, ‘photo-gallery’, ‘adventure-map’, ‘background’, ‘contact’))) {
wp_deregister_script(‘wp_forecast_css’);
}
}
add_action( ‘wp_print_styles’, ‘wpcustom_deregister_scripts_and_styles’, 100 );This function does work for other styles/scripts but not yours. I thought that perhaps it was because the css was being enqueued by a script as opposed to (I think) correctly by a style enqueue.
Anyway, do you know how to correctly unenqueue ‘wp_forecast_css’ which will then not load wp-forecast-default.css ?
Let me know if you have any questions.
- The topic ‘Reduce HTTP Calls…’ is closed to new replies.