Home › Forums › Front-end Issues › wp_query order by custom field › Reply To: wp_query order by custom field
You cannot get a list of one post type ordered by a value of another post type. This is not possible use WP_Query.
To do this any value you want to order by must be a value for the posts that you want to order.
What this means is that when you save a post you must use an acf/save_post action to copy the values you want to be able to order by from the other post type and save it as a meta value for the post being saved.
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.