Title: in_array() expects parameter 2 to be array, null given (nav-menu-template.php)
Last modified: August 21, 2016

---

# in_array() expects parameter 2 to be array, null given (nav-menu-template.php)

 *  [gpcola](https://wordpress.org/support/users/gpcola/)
 * (@gpcola)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/in_array-expects-parameter-2-to-be-array-null-given-nav-menu-templatephp/)
 * I have the following error message displayed right before my menu is rendered
   but ONLY on custom-post-type archive pages:
 * > Warning: in_array() expects parameter 2 to be array, null given in […]wp-includes/
   > nav-menu-template.php on line 440
 * Line 440 of nav-menu-template.php is (the part causing the error at least)
    `
   in_array( $parent_item->object_id, $queried_object->ancestors )`
 * Like I say, this doesn’t affect ordinary posts and didn’t affect custom post 
   types either until I created a custom post type archive page for them.
 * Can anyone help? Thanks 😉

The topic ‘in_array() expects parameter 2 to be array, null given (nav-menu-template.
php)’ is closed to new replies.

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)
 * [nav menu](https://wordpress.org/support/topic-tag/nav-menu/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [gpcola](https://wordpress.org/support/users/gpcola/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/in_array-expects-parameter-2-to-be-array-null-given-nav-menu-templatephp/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
