Support

Account

Home Forums General Issues Querying multiple subfields of the same particular repeater row Reply To: Querying multiple subfields of the same particular repeater row

  • Hi @charlesr

    I believe you can get the head people by using this query:

    'meta_query'	=> array(
        'relation'		=> 'AND',
        array(
            'key'		=> 'person_department_%_person_department_select', // this should be the first sub-field
            'value' => get_the_ID(),
            'compare' => '='
        ),
        array(
            'key'		=> 'person_department_%_person_faculty_type', // this should be the second sub-field
            'value' => 'head',
            'compare' => '='
        )
    )

    And get the supporting people by using this query:

    'meta_query'	=> array(
        'relation'		=> 'AND',
        array(
            'key'		=> 'person_department_%_person_department_select', // this should be the first sub-field
            'value' => get_the_ID(),
            'compare' => '='
        ),
        array(
            'key'		=> 'person_department_%_person_faculty_type', // this should be the second sub-field
            'value' => 'head',
            'compare' => '!='
        )
    )

    If that doesn’t work, could you please open a new ticket and provide temporary credentials to your site here: https://support.advancedcustomfields.com/new-ticket? Don’t forget to provide the link to this thread in the ticket.

    Thanks 🙂