• I have ~300 posts and all these posts have a meta_key name “metakey1”.
    metakey1 can contain different values.

    I want to select all posts that have metakey1 and meta_value either “value1”, “value2”, “value3” or “value5”.

    I have this code today:

    $args = array(
        'post_type' => 'post',
        'post_status' => 'publish',
        'meta_key' => 'metakey1',
        'meta_value' => "value1",
     );
    
    $vininfo = new WP_Query( $args );

    But how can I get all posts that have meta_value = value1, value2, value3 or value 5?

Viewing 1 replies (of 1 total)
  • Thread Starter Urme

    (@urme)

    Noone that can tell me how to achieve this? Either with WP_Query or a custom query. Appreciate all help I can get.

Viewing 1 replies (of 1 total)
  • The topic ‘How to retrieve all posts with these meta_key/meta_values?’ is closed to new replies.