Home › Forums › General Issues › WP_Query orderby date field does not work › Reply To: WP_Query orderby date field does not work
I forgot to reply my own post. I find the issue and the resolution. I post it if anyone ever has the same problem.
Actually, I was using a re-order plugin on the post-type I tried to query, called Post-Types-Order.
This plugin seems to automaticaly apply a filter for all queries that are pointed the re-ordered post-type. Even in your own code.
There’s a way to prevent that in the API, by adding a parameter in the query args :
ignore_custom_sort' => true
You can find an example here : https://www.nsp-code.com/advanced-post-types-order-api/sample-usage/ (Don’t need to get advanced version to use it).
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.