Hi, we are well aware of this problem and working on a patch. For now if you are a developer you can follow this approach in your functions.php file
if(function_exists('onepager')){
add_action('wp_enqueue_scripts', 'remove_my_theme_scripts', 99);
function remove_my_theme_scripts(){
$isOnepage = onepager()->content()->isOnepage();
if(!$isOnepage){
return;
}
//put the script, style handles to remove them on onepager
wp_dequeue_script('my-script-name');
wp_dequeue_style('my-style-name');
}
}
Please let us know if this does not solve your problem. Our patch should land in a week or so.
Thread Starter
debain
(@debain)
Ok, thank you!
This is the code for customizr theme:
if(function_exists('onepager')){
add_action('wp_enqueue_scripts', 'remove_my_theme_scripts', 99);
function remove_my_theme_scripts(){
$isOnepage = onepager()->content()->isOnepage();
if(!$isOnepage){
return;
}
//put the script, style handles to remove them on onepager
//wp_dequeue_script('customizr-common');
wp_dequeue_style('customizr-common');
wp_deregister_style('customizr-common');
}
}
@debain,
Please post any issue on our GitHub repo https://github.com/themexpert/onepager It will help us track the problem.
Thanks again for the patch 🙂