Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

If I use this:

if (is_page(array(blabla-test-page, 20726, 20720, 38881))) {wp_deregister_script( 'gdsr_script' );
}

the blabla-test-page looks like it overrides different pages, even if certain pages have not the same body class.

For example: the page with id 5555 has no body class blabla-test-page, but for some reason, it deregisters this script too... If I remove blabla-test-page and change it to the ID number it has, 5555 will not be affected... How can this be happening? How should I use page name and page id together?

FYI: in the codex, it says is_page( array( 42, 'about-me', 'About Me And Joe' ) ), but when I do this, the page-named class won't deregister the scripts. I think that this is very weird.

share|improve this question
    
blabla-test-page should be in quotes: "blabla-test-page". –  RRikesh Aug 1 '13 at 9:22
    
I just edited my question before you commented. I tried that, but then it does not deregister the scripts of the page with the page-name.... –  Johan Aug 1 '13 at 9:23
    
Are you running(hooking) it after registering the scripts? –  RRikesh Aug 1 '13 at 9:25
    
I am doing this before deregistering add_action( 'wp_print_styles', 'my_deregister_scripts', 100 ); –  Johan Aug 1 '13 at 9:28
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.