DEV Community 👩‍💻👨‍💻

Discussion on: Cannot filter posts by ACF relationship values

vanaf1979 profile image
Stephan Nijman • Edited on

First of you are passing a post_title for a meta field key, while the meta field in this case should just be 'related_university'.

Second the value for this meta field is probably a array of post id's or post objects, not a string like you are passing.

Acf has a nice post about this here:

And as a side note: While you can always ask your questions here, i think you have a better chance of a good answer if you post your questions on StackOverflow:

riyaz7us profile image
riyaz7us Author

Thanks for your reply stephan, However, I was trying to filter my posts (courses in my case) by their related field's (university's) title or other field. I couldn't find a solution for relationship query except one for filtering by ID.