Home › Forums › Front-end Issues › How to Query Relationship Field › Reply To: How to Query Relationship Field
Change the “orderby” arg to ‘orderby’ => ‘meta_value’ and then specify ‘meta_key’ => ‘presenter’ (rather than ‘meta_value’ => ‘presenter’). This will order the query results by the meta_value of ‘presenter’.
It sounds like you’re trying to also query posts with a specific ‘presenter’ value. If so, add to the $args array:
'meta_query' => array(
array(
'key' => 'presenter',
'value' => '"' . $presenter_value . '"',
'compare' => 'LIKE',
)
)
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.