Title: post meta array
Last modified: August 19, 2016

---

# post meta array

 *  [narkiej](https://wordpress.org/support/users/narkiej/)
 * (@narkiej)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/post-meta-array/)
 * How would I turn the following code into an array. I have lots of meta tags: 
   item1, item2, item3 etc. I want a div to appear if ANY ONE of the aforementioned
   meta tags is populated.
 * `<?php if((get_post_meta($post->ID, "item1", true))) { ?>`
 * EG what i want to achive is:
 * `<?php if((get_post_meta($post->ID, "item1 OR item2 OR item3", true))) { ?>`
 * Thank you in advance

Viewing 1 replies (of 1 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/post-meta-array/#post-1686096)
 * have you tried:
 * `<?php if((get_post_meta($post->ID, "item1", false))) { ?>`
 * [http://codex.wordpress.org/Function_Reference/get_post_meta](http://codex.wordpress.org/Function_Reference/get_post_meta)

Viewing 1 replies (of 1 total)

The topic ‘post meta array’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/post-meta-array/#post-1686096)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
