• I woud like to make a query that shows all the post that have 2 especific values in some custom fields. In this example show all post with the fields ‘is_good_person’ equals ‘yes’ and ‘likes_music’ equals ‘No’
    It goes like this:

    <? $args=array('post_type' => 'mytype_post',
                                          'meta_query' => array(
                                                     array(
                                                       'meta_key' => 'is_good_person',
                                       'meta_value' => 'yes',
                                                              ),
                                                     array(
                                                      'key' => 'likes_music',
                                                      'value' => 'No',
    
                                                           )
                                                    )
                     );
    $wp_query->query($args);
  • The topic ‘Wp query with multiple meta_keys values’ is closed to new replies.