how can i remove js file from my footer in wordpress
-
22-04-2021 - |
문제
i want to remove a specific js file from specific template. i have seen sone solutions and try them but got no result. following i am writing the code which i tried.
add_action('wp_enqueue_scripts','theme_slug_dequeue_footer_jquery');
function theme_slug_dequeue_footer_jquery() {
if ( is_page_template('property_list_half.php') ) {
wp_dequeue_script('directory-js');
wp_deregister_script('directory-js');
}
}
해결책
Try this out. The -js is added by WordPress, so you don't need it when you are calling it.
function theme_slug_dequeue_footer_jquery() {
if ( is_page_template('property_list_half.php') ) {
wp_dequeue_style( 'directory' );
}
}
add_action('wp_enqueue_scripts','theme_slug_dequeue_footer_jquery');
제휴하지 않습니다 wordpress.stackexchange