Home › Forums › General Issues › Meta query key with POST OBJECT (ACF) (post_title) in wordpress › Reply To: Meta query key with POST OBJECT (ACF) (post_title) in wordpress
You cannot compare a text value with a post object field. A post object field holds only the ID of the post object. The title of the post object is part of that other post and not part of the relationship field.
Their is nothing built into WP that will let you do this in a single query.
You would first need to search the posts of the other post type to get the ID based on the text. Then you can use the ID value(s) returned by this first query in your second query.
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.