Home › Forums › Backend Issues (wp-admin) › Sorting search results by ACF date fields › Reply To: Sorting search results by ACF date fields
You have 2 problems
The first is an error in your code, this
$query->is_search
should be this
$query->is_search()
The second thing is that ordering by several fields is not going to work the way I suspect you think it will or want it do. The second field will be order within the order or the first. An example:
Let’s say that you have two fields
and you order the posts first by state and then by county. It will order all of the posts alphabetically by state and then by county within each state.
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.