Home › Forums › Front-end Issues › Sort custom term archive by ACF date › Reply To: Sort custom term archive by ACF date
You cannot sort in WP with two different meta fields and have the posts intermingled based on the two fields. You also cannot sort post differently based on whether or not they have a specific term.
My suggestion would be to create an acf/save_post action. In this action copy one of the two fields based on the post’s terms to a 3rd custom field using update_post_meta(). This field would not be editable in ACF. Then use this 3rd field to for post ordering.
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.