If you know how to modify your own Theme code, you could for now add something like this to your ‘functions.php’ under your theme:
function dequeue_conditional_styles(){
if( (!strpos($_SERVER["REQUEST_URI"], 'faqs')) ) {
$removeFAQScript = false;
if (function_exists( 'is_woocommerce' )) {
if (!is_woocommerce()) {
$removeFAQScript = true;
}
} else {
$removeFAQScript = true;
}
if ($removeFAQScript) {
wp_dequeue_style('ewd-ufaq-style');
wp_dequeue_style('ewd-ufaq-rrssb');
wp_dequeue_script('ewd-ufaq-js');
wp_dequeue_script('jquery-ui-core');
}
wp_dequeue_script('jquery-effects-core');
wp_dequeue_script('jquery-ui-autocomplete');
wp_dequeue_script('jquery-effects-blind');
wp_dequeue_script('jquery-effects-bounce');
wp_dequeue_script('jquery-effects-clip');
wp_dequeue_script('jquery-effects-drop');
wp_dequeue_script('jquery-effects-explode');
wp_dequeue_script('jquery-effects-fade');
wp_dequeue_script('jquery-effects-fold');
wp_dequeue_script('jquery-effects-highlight');
wp_dequeue_script('jquery-effects-pulsate');
wp_dequeue_script('jquery-effects-scale');
wp_dequeue_script('jquery-effects-shake');
wp_dequeue_script('jquery-effects-slide');
wp_dequeue_script('jquery-effects-transfer');
}
}
add_action( 'wp_enqueue_scripts', 'dequeue_conditional_styles', 20 );
This is basically checking the pages URL doesn’t have ‘faqs’ in it (adjust if your base FAQ URL slug is named something else).
It also checks if the Woocommerce plugin is available, and if so ensures not to remove the main scripts from the Woocommerce products pages (incase you have Ultimate FAQs on them too). The effects are still removed, but you can adjust to your desire. Any issues, tweak or remove it. It’s just a temporary patch for now, but should do the trick.
If you require those scripts such as jQuery UI Core or Effects for other webpage/plugin uses, don’t remove them.
-
This reply was modified 7 years, 12 months ago by 3Lancer.
-
This reply was modified 7 years, 12 months ago by 3Lancer.