How can I display all values of a custom field from posts with a certain value of another custom field or from certain post types?

take a look at the reference docs for the WP_Query class: http://codex.wordpress.org/Class_Reference/WP_Query

something like this:

$args = array(
  //some key/value pairs...whatever
          'meta_query => array(
                          array(
                         'key' => somekey,
                         'value' => somevalue,
                         'compare' => some comparison operator
                         ),
                         array(
                         'key' => some other key,
                         'value' => some other value,
                         'compare' => some comparison operator
                         )
                     )
               )

$my_query = new WP_Query( $args );

//some code to do something with the results of the query

Leave a Comment