Home › Forums › Front-end Issues › wp_query Orderby multiple meta doesnt work › Reply To: wp_query Orderby multiple meta doesnt work
Sorry for the long wait.. tried this code but doesnt work correctly.
The “activi_datum” is empty for the post that doesnt have “activi_datumperiode” enabled. Its a conditional field.
If “activi_datumperiode” turned on == enable “activi_datum” field.
If “activi_datumperiode” turned off == enable “free text” field.
What your code outputs is an ASC date list without the posts without a date.
Simply changing the relation “AND” in “OR” fixes the issue only orderby Date doenst work anymore.
22-03-2023
22-02-2023
28-03-2023
28-06-2023
11-05-2023
Every monday
Every Sunday
Looks like it orders by “activi_datumperiode” and then by post creation date
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!
CPT registration is coming to ACF! We demoed the new feature during the most recent session of ACF Chat Fridays. Check out the summary for the details. https://t.co/k2KQ3WWBAz
— Advanced Custom Fields (@wp_acf) March 7, 2023
© 2023 Advanced Custom Fields.
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 Cookie Policy. If you continue to use this site, you consent to our use of cookies.