Title: If statement for all pages except array
Last modified: August 20, 2016

---

# If statement for all pages except array

 *  Resolved [chairbeat](https://wordpress.org/support/users/chairbeat/)
 * (@chairbeat)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/if-statement-for-all-pages-except-array/)
 * Hi! I’m trying to deregister scripts for certain pages within my functions file,
   but I want to deregister them for every page except one. Right now the code is
   something like this:
 *     ```
       $post_id 			= $_GET['post'] ? $_GET['post'] : $_POST['post_ID'];
   
       function childtheme_deregister_scripts() {
       	if (  !$post_id == '116' && is_page() || 'blog' == get_post_type()  ) {
       		wp_deregister_script( 'wp-e-commerce' );
       		wp_deregister_script( 'wp-e-commerce-ajax-legacy' );
       		wp_deregister_script( 'wp-e-commerce-dynamic' );
       		wp_deregister_script( 'livequery' );
       		wp_deregister_script( 'wpsc-gold-cart' );
       		wp_deregister_script( 'wp-e-commerce-legacy' );
       	}
       ```
   
 * I thought I could do something like `if (is_page() XOR $post_id == '116' )` but
   that wasn’t working either. I’m kind of a newbie to PHP.
 * Any ideas? Thanks in advance!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/if-statement-for-all-pages-except-array/#post-2643109)
 * if 116 is the page id, have you tried:
 * `!is_page(116)`
 * [http://codex.wordpress.org/Function_Reference/is_page](http://codex.wordpress.org/Function_Reference/is_page)
 *  Thread Starter [chairbeat](https://wordpress.org/support/users/chairbeat/)
 * (@chairbeat)
 * [14 years, 2 months ago](https://wordpress.org/support/topic/if-statement-for-all-pages-except-array/#post-2643213)
 * Hey, thank you alchymyth, That seems to work well. I now am using
 * `if ( !is_page(array(116)) && is_page() || !'products' == get_post_type())`

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘If statement for all pages except array’ is closed to new replies.

## Tags

 * [functions](https://wordpress.org/support/topic-tag/functions/)
 * [if](https://wordpress.org/support/topic-tag/if/)
 * [limit](https://wordpress.org/support/topic-tag/limit/)
 * [pages](https://wordpress.org/support/topic-tag/pages/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 2 replies
 * 2 participants
 * Last reply from: [chairbeat](https://wordpress.org/support/users/chairbeat/)
 * Last activity: [14 years, 2 months ago](https://wordpress.org/support/topic/if-statement-for-all-pages-except-array/#post-2643213)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
