Support

Account

Home › Forums › Front-end Issues › Wp_query with relationship to another custom post type › Reply To: Wp_query with relationship to another custom post type

  • Wouldn’t you query the hospitals first then?

    Example:

    1) Get all Branch IDs of all hospitals, where Recommended = TRUE
    2) Add all those IDs to an array
    3) Remove duplicates from the array of Branch IDs
    4) Query Branches with Post IDs in ( post__in ) your array

    Am I understanding correctly?