Support

Account

Home Forums Front-end Issues Limit relationship posts per page Reply To: Limit relationship posts per page

  • So I want to do something similar to this and I understand the solution of returning the IDs and using a WP_Query to get only the ones I want. Obviously that creates an extra DB call, so my question is one of performance. Is it better to return the IDs and do the extra WP_Query or would it work to just use PHP to limit the array result after the fact with PHP? Maybe using array_slice For example:

    
    $posts = get_field('conference_talks');
    $posts= array_slice($posts, 0, 5);