Title: Multiple meta_value in get_posts
Last modified: August 19, 2016

---

# Multiple meta_value in get_posts

 *  [chizet](https://wordpress.org/support/users/chizet/)
 * (@chizet)
 * [15 years, 11 months ago](https://wordpress.org/support/topic/multiple-meta_value-in-get_posts/)
 * I’m using get_posts to create a new loop. I’d like the loop to pull pages that
   have two different custom field values (but the same custom field key) – is it
   possible to do that? I’ve tried comma and space separating the values to no avail.
   Here’s my code:
 *     ```
       <?php
       $postslist = get_posts('post_type=page&meta_key=status_type&<strong>meta_value</strong>=incident&exclude=2&post_parent=0');
       					    foreach ($postslist as $post) :
       					    $customPostID = get_post_custom($post->ID);
       ?>
       ```
   

The topic ‘Multiple meta_value in get_posts’ is closed to new replies.

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)
 * [get_posts](https://wordpress.org/support/topic-tag/get_posts/)
 * [meta_value)](https://wordpress.org/support/topic-tag/meta_value/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [chizet](https://wordpress.org/support/users/chizet/)
 * Last activity: [15 years, 11 months ago](https://wordpress.org/support/topic/multiple-meta_value-in-get_posts/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
