Support

Account

Home Forums General Issues Query in relationship field Reply To: Query in relationship field

  • This tutorial goes over everything you need to query relationship fields http://www.advancedcustomfields.com/resources/querying-relationship-fields/

    Basically, for what you want you need to use “LIKE” and the double quotes around the value are important.

    
    $args = array(
       'numberposts' => -1,
        'post_type' => 'post',
        'meta_query' => array(
            array(
                'key' => 'relation_user',
                'value' => '"1"',
                'compare' => 'LIKE',
           )
        )
    );