Title: Warning: array_key_exists()
Last modified: August 18, 2016

---

# Warning: array_key_exists()

 *  Resolved [blt-fqx](https://wordpress.org/support/users/blt-fqx/)
 * (@blt-fqx)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/warning-array_key_exists/)
 * After I upgrade from 2.2.2 to 2.3-b1, the following message appears above each
   post of my blog.
 * Warning: array_key_exists() [function.array-key-exists]: The first argument should
   be either a string or an integer in /wp-includes/category-template.php on line
   168
 * And in line 168
    if(array_key_exists($category, $categories))
 * I searched but found nothing.

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

 *  Thread Starter [blt-fqx](https://wordpress.org/support/users/blt-fqx/)
 * (@blt-fqx)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/warning-array_key_exists/#post-614087)
 * Upgraded the theme and solved.
 *  [voiceofbragg](https://wordpress.org/support/users/voiceofbragg/)
 * (@voiceofbragg)
 * [18 years, 7 months ago](https://wordpress.org/support/topic/warning-array_key_exists/#post-614267)
 * Go to [voiceofbragg.com](http://www.voiceofbragg.com) to see how I fixed it.
 *  [bmediaventures](https://wordpress.org/support/users/bmediaventures/)
 * (@bmediaventures)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/warning-array_key_exists/#post-614306)
 * What do you mean by upgraded theme? i’m having the same problem on blastmagazine.
   com
 *  [flammable](https://wordpress.org/support/users/flammable/)
 * (@flammable)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/warning-array_key_exists/#post-614307)
 * Having the same issue (upgraded a test install). Switched back to Kubrick, the
   default theme, which didn’t show the same problems – and turned off all of my
   plugins, so it can’t be them.
 * As I’ve narrowed it down to my theme, is there a place I should be looking to
   figure out how to fix this? I don’t want to modify WP core code, but that’s where
   the error leads to.
 *  [flammable](https://wordpress.org/support/users/flammable/)
 * (@flammable)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/warning-array_key_exists/#post-614308)
 * Okay, I don’t know if this will do it for everyone…but it seems that my theme
   has some extra features that I don’t use, and one of them was causing these issues.
   I’m using the [3-column Relaxation theme](http://themes.orth.me.uk/3col_rex_ver1/index.php).
 * It required me to alter the loop a bit from the theme’s version…here’s the before:
 *     ```
       <?php if (have_posts()) : ?>
   
       <?php while (have_posts()) : the_post(); ?>
       <?php if ( !(in_category(get_settings('3cr_v1_asides_cats_to_exclude_from_blog'))) ) { ?>
   
       <div class="post">
       <h1 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>
       <p class="date"><?php the_time('F jS, Y') ?> by <?php the_author('namefl'); ?>
   
       <div class="entry">
       <?php the_content('[more...]'); ?>
       </div>
   
       <!--
       <?php trackback_rdf(); ?>
       -->
       <?php if(!is_single() && ($post==$posts[get_settings('3cr_v1_google_contentarea_adsense_code_pos1')] OR $post==$posts[get_settings('three_column_relax_v1_google_contentarea_adsense_code_pos2')])) { ?>
       <?php echo stripslashes(get_settings('3cr_v1_v1_google_contentarea_adsense_code')); ?>
   
       <?php } ?>
       </div>
       <?php }; ?>
       <?php endwhile; ?>
       ```
   
 * to:
 *     ```
       <?php if (have_posts()) : ?>
   
       <?php while (have_posts()) : the_post(); ?>
   
       <div class="post">
       <h1 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h1>
       <p class="date"><?php the_time('F jS, Y') ?> by <?php the_author('namefl'); ?>
   
       <div class="entry">
       <?php the_content('[more...]'); ?>
       </div>
       </div>
       <?php endwhile; ?>
       ```
   
 * I know it probably won’t fix it for everyone (if anyone else), but hopefully 
   it’ll help some people track down the problem for themselves.
 *  [texoor](https://wordpress.org/support/users/texoor/)
 * (@texoor)
 * [18 years, 3 months ago](https://wordpress.org/support/topic/warning-array_key_exists/#post-614341)
 * Follow this post to find what worked for me while [building the Openquarter website](http://www.openquarter.com):
   [http://wordpress.org/support/topic/136343?replies=11](http://wordpress.org/support/topic/136343?replies=11)
 *  [sky7998](https://wordpress.org/support/users/sky7998/)
 * (@sky7998)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/warning-array_key_exists/#post-614349)
 * I’m considering installing the 2.5 Beta on site of [small dogs](http://www.dogbreedss.org/small-dogs.htm)
   in a ‘beta’ folder for further testing, alongside the current 2.3.3 install. (
   so if 2.3.3 is under “blog” then 2.5 would be installed under “blog-beta” to 
   keep it separate). They’d be running off of the same wordpress database and would
   use the same folder for uploads to keep images in sync.
 *  [flammable](https://wordpress.org/support/users/flammable/)
 * (@flammable)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/warning-array_key_exists/#post-614350)
 * sky7998, I think you might have replied to the wrong topic. 🙂

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

The topic ‘Warning: array_key_exists()’ is closed to new replies.

## Tags

 * [array_key_exists](https://wordpress.org/support/topic-tag/array_key_exists/)
 * [category template](https://wordpress.org/support/topic-tag/category-template/)
 * [upgrade](https://wordpress.org/support/topic-tag/upgrade/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * In: [Alpha/Beta/RC](https://wordpress.org/support/forum/alphabeta/)
 * 8 replies
 * 6 participants
 * Last reply from: [flammable](https://wordpress.org/support/users/flammable/)
 * Last activity: [17 years, 11 months ago](https://wordpress.org/support/topic/warning-array_key_exists/#post-614350)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
