I’d like to be able to pull up query results that are related using the ACF relationship field.
e.g. I’ve added a relationship field for a custom post type called “Artist” to a “Product” custom post type.
Would like to be able to do keyword search for products by a certain artist by typing the name of the artist.
I don’t think I can do this by a join operation since the relationship field is not really a join table but a field.
Hi @bluecomet
You can achieve this by using the WP_Query object.
To search, you can simply provide a value for s
.
To limit the results to those related via a relationship field, please read this guide:
http://www.advancedcustomfields.com/resources/tutorials/querying-relationship-fields/
Thanks
E