Support

Account

Home Forums ACF PRO Ordering issue with repeater field

Unread

Ordering issue with repeater field

  • Hi guys,

    I am having an issue with the ordering of a repeater field.

    I have a post object (people custom post type) in my repeater field and have them dragged to their correct positions. I then add this array of post IDs for use in a WP_Query to display them in that exact order. Although, some times this ordering doesn’t work (like in this case).

    My ordering is like so:

    array(4) {
      [0]=>
      int(75)
      [1]=>
      int(514)
      [2]=>
      int(87)
      [3]=>
      int(464)
    }

    My WP_Query args are as follows

    $args = array(
       'post_type' => 'person',
       'posts_per_page' => -1,
       'post__in' => $chosen_people_array,
       'orderby' => 'post__in'
    );

    Incorrect ordering when outputted from query

    <div class="person-item" id="id-75"></div>
    <div class="person-item" id="id-514"></div>
    <div class="person-item" id="id-464"></div>
    <div class="person-item" id="id-87"></div>

    Here is a little video of the issue

    https://www.youtube.com/watch?v=39iqyiX9Kcw

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.