Hi @egornmore ,
Thanks for reaching out!
Please let me check this with the dev and I will feed you back as soon as possible.
Kind regards,
Alina
Hi @egornmore ,
Thanks for your patience. In frontend there is no way to determine which exactly page has been used contact form to load scripts file and styles. Even Contact form 7 also works like this. But you can try by referring to this doc https://developer.ww.wp.xz.cn/reference/hooks/wp_enqueue_scripts/
Hope that clears. If you need further help, please let us know.
Many thanks!
Mia
Hi @mialewp,
I can target the page manually, by is_page(id). Should dequeue be something like that – remove_action('wp_enqueue_scripts', 'cf7mls', 20, 0); ?
Hi @egornmore ,
Please use this function:
wp_dequeue_script( 'cf7mls' )
Kind regards,
Alina
-
This reply was modified 3 years, 3 months ago by
alina98.
Tried wp_dequeue_style( 'cf7mls-css' );, wp_dequeue_style( 'cf7mls' );,wp_dequeue_script( 'cf7mls' ); but styles and scripts still there
-
This reply was modified 3 years, 3 months ago by
egornmore.
Hi @egornmore ,
Please let me check this with the dev and I will feed you back as soon as possible.
Kind regards,
Alina
Hi @egornmore ,
Please try to use this code
add_action( ‘wp_enqueue_scripts’, ‘remove_cf7mls_scripts_and_style’ );
function remove_cf7mls_scripts_and_style() {
wp_dequeue_style( ‘cf7mls-css’ );
wp_dequeue_style( ‘cf7mls’ );
wp_dequeue_script( ‘cf7mls’ );
}
If you have any questions, feel free to contact us.
Many thanks!
Mia
Hi @mialewp that solution works for me, thanks!
Also added animate and progress bar styles:
add_action( 'wp_enqueue_scripts', 'remove_cf7mls_scripts_and_style' );
function remove_cf7mls_scripts_and_style() {
if(!is_page($id)) {
wp_dequeue_style('cf7mls');
wp_dequeue_script('cf7mls');
wp_dequeue_style('cf7mls_animate');
wp_dequeue_style('cf7mls_progress_bar');
}
}
-
This reply was modified 3 years, 3 months ago by
egornmore.
-
This reply was modified 3 years, 3 months ago by
egornmore.