Home › Forums › ACF PRO › WP_Query and sub-fields › Reply To: WP_Query and sub-fields
Sorry @acf-support / James, it’s working fine actually. Apologies.
One thing I have noticed though and maybe good for another thread actually. But I also need to order the posts returned in time order. I have a custom field (within the same repeater) called ‘start_time’ and the posts need to be ordered by that… Any ideas how I modify my WP_Query for that?
<?php
$args = array(
'posts_per_page' => -1,
'post_type' => 'schedule',
'order' => 'ASC',
'orderby' => 'meta_value_num',
'meta_key' => 'schedule_time_slot_%_schedule_date',
'meta_query' => array(
array(
'key' => 'schedule_time_slot_%_schedule_date',
'compare' => '=',
'value' => $mon,
'type' => 'DATE',
)
)
);
?>
Your help is much appreciated.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
🚀 This week’s session of ACF Chat Fridays dips into the preliminary results of our first ever user survey. Don’t miss it! https://t.co/3UtvQbDwNm pic.twitter.com/kMwhaJTkZc
— Advanced Custom Fields (@wp_acf) May 9, 2023
© 2023 Advanced Custom Fields.
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.