Home › Forums › Backend Issues (wp-admin) › Search relationship on custom field › Reply To: Search relationship on custom field
I’m assuming that you’re getting no results.
The reason is that even though you are putting an OR
in your meta query it doesn’t have any effect because when WP runs the query it is looking for the search value in the title AND
in the post meta value.
I believe this question has been asked before. As far as I know there isn’t any way in WP to do a query where something can appear in the title or in a post meta field. You’ll either end up getting everything or nothing.
The only way to successfully do a search like this it to write your own SQL queries using $wpdb
. It’s a limitation in WP_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.