Home › Forums › ACF PRO › WP_Query and sub-fields › Reply To: WP_Query and sub-fields
I’m afraid the ordering post by subfield is not possible. What you can do is creating a dummy fields that will hold the time field for the post. That way you can query the post normally. This page should give you more idea about it: https://www.advancedcustomfields.com/resources/orde-posts-by-custom-fields/.
If you still need to order by the subfield, I’m afraid you need to use the wpdb class instead. This page should give you more idea about it: https://codex.wordpress.org/Class_Reference/wpdb.
I hope this helps 🙂
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!
❓Ever wondered when and why ACF uses JSON instead of the database? Check out our summary of the most recent session of ACF Chat Friday for the answer, and make sure to register for the next session.— Advanced Custom Fields (@wp_acf) February 23, 2023
© 2023 Advanced Custom Fields.