plugins - Why can I not deregister my style and script on custom post type?

I have a website where I have a custom post type with some single pages attached to it.Problem: I can't deregister

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

相关推荐

  • plugins - Why can I not deregister my style and script on custom post type?

    I have a website where I have a custom post type with some single pages attached to it.Problem: I can't deregister

    1天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信