I have a website where I have a custom post type with some single pages attached to it.
Problem: I can't deregister the scripts and styles on my custom post type single pages.
This is my code:
add_action( 'wp_print_scripts', 'my_deregister_javascript', 100 );
function my_deregister_javascript() {
if (is_page(array(20720, 38881))) {
wp_deregister_script( 'basic-comment-quicktags' );
}
elseif (is_home()) {
wp_deregister_script( 'theme-my-login-ajax' );
}
elseif (is_singular( 'name-of-my-custom-post-type' )) {
wp_deregister_script( 'incom-js');
}
elseif (is_page(array(alfabet-page))) {
wp_deregister_script( 'wp-favroite-posts' );
wp_deregister_script( 'basic-comment-quicktags' );
}
So you can see that I am using it like this:
elseif (is_singular( 'name-of-my-custom-post-type' )) {
wp_deregister_script( 'incom-js');
}
Yet this does not work for me. What am I doing wrong?
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744976305a4604165.html
评论列表(0条)