Home › Forums › Front-end Issues › Sorting by relational linked user fields › Reply To: Sorting by relational linked user fields
The only thing stored for each post is the id of the related item. There isn’t any way to sort this by anything else unless you build a way to do it.
For example, create an acf/save_post action that gets the user and saves another custom field value, not an ACF field, using update_postmeta() with a new field name to hold the value you want to sort posts by. Then you use this field in your query to sort the posts.
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.