Support

Account

Forum Replies Created

  • OK, I managed to solve it by myself… the main problem was, that I used the name of the custom post type instead of the name of the ACF-relationship-field.

    	$methods = get_posts(array(
    		'post_type' => 'page',
    		'meta_query' => array(
    			array(
    			'key' => 'persons', // name of custom field
    			'value' => '"' . get_the_ID() . '"', // matches exaclty "123", not just 123. This prevents a match for "1234"
    			'compare' => 'LIKE'
    			)
    		)
    	));
    
Viewing 1 post (of 1 total)