Use WP_query to match post types based on custom field values
In the WP Docs you can find the answer. I have not tested this snippet, but it should become something like this: $args = array( ‘post_type’ => ‘product’, ‘meta_query’ => array( ‘relation’ => ‘AND’, array( ‘key’ => ‘product-ean’, ‘value’ => 123, ‘compare’ => ‘=’, ), array( ‘key’ => ‘item-ean’, ‘value’ => 123, ‘compare’ => ‘=’, … Read more