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.
https://i.imgur.com/m1GdSfe.png
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 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.