Support

Account

Home Forums General Issues Search in 3 different custom posts using 3 diferent custom fields Reply To: Search in 3 different custom posts using 3 diferent custom fields

  • Relationship fields are stored as an array of post IDs, so you will need the ID of the place you want to search for.

    A radio field holds a text value.

    
    $meta_query = array(
      // relationship field => ID values
      array(
        'key' => 'relationship_field_name',
        'value' => '"'.$post_id.'"',
        'compare' => 'LIKE'
      ),
      // radio field
      array(
        'key' => 'radio_field_name',
        'value => $location
      )
    )