Support

Account

Home Forums General Issues Relationship query filter not working Reply To: Relationship query filter not working

  • My question would be why are you letting users choose an unlimited number of post when you will only show 3? Is there some case where you’re going to show more than 3?

    You can get the unformatted value of the field

    
    $posts = get_field('relationship_field_name', false, false);
    

    This will return just an array of post IDs and not have the overhead of getting many posts. Then you can use this array in your own WP_Query() to get the number of posts that you want using the “post__in” argument to only get posts that are included in the field and limit the query (posts_per_page) to 3. This is what ACF does when it formats the value except for the limit.