Title: Using Arrays
Last modified: March 14, 2017

---

# Using Arrays

 *  Resolved [David Bennett](https://wordpress.org/support/users/djbdjb/)
 * (@djbdjb)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/using-arrays/)
 * Hi
 * The plugin’s working great when targeting a single page but I want to target 
   a few using an array – is that possible?
 * This works fine:
    <?php if ( is_page(7265)) { ?>
 * This doesn’t work:
    <?php if ( is_page(array(7265,7290,8471,10680,8356)) { ?>
 * Not the end of the world if not, I just copy the code five times 😉

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

 *  Thread Starter [David Bennett](https://wordpress.org/support/users/djbdjb/)
 * (@djbdjb)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/using-arrays/#post-8911648)
 * I’ve answered my own question, I was missing a closing bracket!
 * <?php if ( is_page( array( 7265, 7290, 8471, 10680, 8356 ) ) ) { ?>
 *  Plugin Author [Stefano Lissa](https://wordpress.org/support/users/satollo/)
 * (@satollo)
 * [9 years, 2 months ago](https://wordpress.org/support/topic/using-arrays/#post-8911715)
 * uhm I don’t like too much that code. Check the array_search() php function instead.
 * Pay attention to use !== false on the result (two “=”).
 * Stefano.

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

The topic ‘Using Arrays’ is closed to new replies.

 * ![](https://ps.w.org/header-footer/assets/icon-256x256.png?rev=3452717)
 * [Head, Footer and Post Injections](https://wordpress.org/plugins/header-footer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/header-footer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/header-footer/)
 * [Active Topics](https://wordpress.org/support/plugin/header-footer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/header-footer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/header-footer/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Stefano Lissa](https://wordpress.org/support/users/satollo/)
 * Last activity: [9 years, 2 months ago](https://wordpress.org/support/topic/using-arrays/#post-8911715)
 * Status: resolved