Title: Array Not excluding categories
Last modified: August 24, 2016

---

# Array Not excluding categories

 *  Resolved [meskunas](https://wordpress.org/support/users/meskunas/)
 * (@meskunas)
 * [11 years ago](https://wordpress.org/support/topic/array-not-excluding-categories/)
 * I have this included in the header of every page just before the closing </head
   >
 * <?php
    if (is_front_page()) { include(“empty.php”); } elseif (is_home()) { include(“
   empty.php”); } elseif (is_page( array(‘691’, ‘32003’, ‘26160’, ‘35582’, ‘34751’,‘
   34351’, ‘32510’, ‘32275’, ’28’, ’34’, ‘295’, ‘671’, ‘674’, ‘686’, ‘847’, ‘857’,‘
   2527’, ‘1890’, ‘2056’, ‘6588’, ‘12912’, ‘668’, ‘259’, ‘2013’, ‘833’, ‘853’, ‘
   850’, ‘2072’, ‘2064’, ‘2077’, ‘2052’))) { include(“empty.php”); } elseif (is_single(
   array(‘480’, ‘36094’))) { include(“empty.php”); } elseif (is_category( array(’
   42’, ’26’, ‘marketplace’, ‘Obituaries’, ‘obituaries’))) { include(“empty.php”);}
   else { include(“paywall.php”); } ?>
 * It is not working when folks are looking at individual posts under category 26
   obituaries.
 * Permanlink format is custom: /%post_id%/%postname%/
 * Is it because it doesn’t know that the page contains that category yet?
 * – Jim

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

 *  Thread Starter [meskunas](https://wordpress.org/support/users/meskunas/)
 * (@meskunas)
 * [11 years ago](https://wordpress.org/support/topic/array-not-excluding-categories/#post-6039532)
 * Note, this was working until WordPress 4.1.2 was released.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [11 years ago](https://wordpress.org/support/topic/array-not-excluding-categories/#post-6039538)
 * > when folks are looking at individual posts under category 26 obituaries
 * `is_category()` only checks for category archives;
 * try to use `in_category()` although that might not be reliable if used outside
   the loop.
 *  Thread Starter [meskunas](https://wordpress.org/support/users/meskunas/)
 * (@meskunas)
 * [11 years ago](https://wordpress.org/support/topic/array-not-excluding-categories/#post-6039682)
 * Thank you, this cured it.

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

The topic ‘Array Not excluding categories’ is closed to new replies.

## Tags

 * [category](https://wordpress.org/support/topic-tag/category/)
 * [exclude](https://wordpress.org/support/topic-tag/exclude/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [meskunas](https://wordpress.org/support/users/meskunas/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/array-not-excluding-categories/#post-6039682)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
