Home › Forums › General Issues › How to order by custom field then post date? › Reply To: How to order by custom field then post date?
Field type is True/False… all the rest of it is just the defaults. I’m not seeing that it means it’s a serialized array or radio field or anything, all I know is it’s True/False and I can do an orderby query for it by itself or by the post date by itself but not sure how to integrate it with a date orderby where the checked items of “Gallery” true show at the top then the secondary order is by post date.
My SQL would look like SELECT * FROM POSTS ORDER BY GALLERY, DATE.
So the posts would come out like this:
Post 5 (is Gallery) date Jan 19
Post 7 (is Gallery) date Jan 17
Post 3 (is not Gallery) date Jan 20
Post 4 (is not Gallery) date Jan 12
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’re reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 Advanced Custom Fields.