Support

Account

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