Support

Account

Home Forums Feature Requests Post_object post Reply To: Post_object post

  • If the post object field can only have one value then what you have should work. It will not work if your post object field allows multiple selections. If that’s the case then you need to change the meta query to

    
    $args = array(
    	'post_type'	=> 'post',
    	'posts_per_page'=> -1,
    	'meta_query'	=> array(
    	array(
    		'key' => 'attraction_in',
    		'value' =>  '"'.$post_id.'"',
    		'compare' => 'LIKE'
    		)
    	)
    );
    

    this is explained in the “single-location.php” section of this page https://www.advancedcustomfields.com/resources/querying-relationship-fields/