- This topic has 3 replies, 2 voices, and was last updated 3 years, 12 months ago by .
I have a custom post type for events. I am using the Meta Box date/time field and have it set to “clone” so I can add multiple event times (for events that take place on more than one day). Since that field now contains an array, my custom WP_Query isn’t sorting the results using that meta_key. I originally had created this with a single date/time field (not able to clone) so the sorting worked perfectly.
How can I modify my query args (below) to use the first item in the array for the orderby value?
'meta_key' => 'event_start', 'orderby' => 'meta_value', 'order' => 'ASC',
- The topic ‘Use repeatable Meta Box field for query orderby’ is closed to new replies.