Home › Forums › General Issues › Sort post by time picker field doesn't work › Reply To: Sort post by time picker field doesn't work
That’s the query:
SELECT SQL_CALC_FOUND_ROWS wp_gqw8d5_posts.ID FROM wp_gqw8d5_posts INNER JOIN wp_gqw8d5_postmeta ON ( wp_gqw8d5_posts.ID = wp_gqw8d5_postmeta.post_id ) WHERE 1=1 AND ( wp_gqw8d5_postmeta.meta_key = ‘my_date_time’ ) AND wp_gqw8d5_posts.post_type = ‘myposttype’ AND (wp_gqw8d5_posts.post_status = ‘publish’ OR wp_gqw8d5_posts.post_status = ‘acf-disabled’ OR wp_gqw8d5_posts.post_status = ‘private’) GROUP BY wp_gqw8d5_posts.ID ORDER BY wp_gqw8d5_postmeta.meta_value+0 DESC LIMIT 0, 10
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!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.