wp_dequeue_script page speed help
-
I have created a custom wp_dequeue script function in my functions.php, some of the dequeues work fine but others are simply ignored, i have cut the example code down to only include some of those that are not working:
add_action('wp_enqueue_scripts','custom_conditional_loading'); function custom_conditional_loading(){ wp_dequeue_script('jquery-ui-core'); wp_dequeue_script('moment-js'); wp_dequeue_script('moment-core-js'); if(! is_page(825)) { wp_enqueue_script('jquery-ui-core'); wp_enqueue_script('moment-js'); wp_enqueue_script('moment-core-js'); } }
I am really trying to improve the performance on the website and there are a lot of unnecessary files being loaded, am I doing this wrong?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘wp_dequeue_script page speed help’ is closed to new replies.