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