Support

Account

Home Forums General Issues Getting Field Value of A Different CPT through Relationship with WP_Query Reply To: Getting Field Value of A Different CPT through Relationship with WP_Query

  • You cannot to want to do. You cannot query or order posts by a relationship field or by a value of the related post.

    In order query by this value you need to copy the value to the post(s) that you need to use it for. You can do this using an acf/save_post filter that runs when saving post type “solution”, get the value from the related “vendor” and store it in the meta table attached to the “solution”

    Another possibility is to query vendors to get a list of sponsored vendors and then somehow alter the solution query using the list of posts returned.

    Sorry, I don’t have example code for doing either.