Title: Using is_page with array
Last modified: August 19, 2016

---

# Using is_page with array

 *  Resolved [vagamente](https://wordpress.org/support/users/vagamente/)
 * (@vagamente)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/using-is_page-with-array/)
 * Hi all.
 * I’m trying to use the is_page conditional tag with array inside.
 * I know that I can declare array inside is_tag, but can I use array of array?
 * I mean something like this:
 *     ```
       $paginediservizio=array('355','992','988','990','592','882','528');
       $paginelinguabase=array('1167','1168','1169','1171');
       if (is_page(array($paginediservizio,$paginelinguabase) {
           [...]
       }
       ```
   
 * It doesn’t work. No errors, just doesn’t output “true” in the right pages.
 * Any suggestion why?
 * Thanks

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

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/using-is_page-with-array/#post-1736633)
 * That’s because you’re passing in a multidimensional array, which won’t work..
   and additionally you’re missing two right brackets on the is_page condition (
   might not exist in your actual code though).
 * Merge the two arrays..
 *     ```
       $paginediservizio=array('355','992','988','990','592','882','528');
       $paginelinguabase=array('1167','1168','1169','1171');
   
       $merged_page_ids = array_merge( $paginediservizio, $paginelinguabase );
   
       if( is_page( $merged_page_ids ) ) {
       // Etc...
       ```
   
 * Hope that helps..
 *  Thread Starter [vagamente](https://wordpress.org/support/users/vagamente/)
 * (@vagamente)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/using-is_page-with-array/#post-1736642)
 * Yep… that solved it…
 * Thanks
 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/using-is_page-with-array/#post-1736655)
 * Happy to help.. 🙂

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

The topic ‘Using is_page with array’ is closed to new replies.

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [is_page](https://wordpress.org/support/topic-tag/is_page/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/using-is_page-with-array/#post-1736655)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
