Support

Account

Home Forums General Issues Getting (and grouping) relation post object category Reply To: Getting (and grouping) relation post object category

  • Without querying the DB directly there really is not any way to group post by its terms.

    You would need to
    1) Get the Post IDs in the relationship field.
    2) Get a list of all of the terms
    3) Do a query with a tax_query for each term and use the post IDs returned in #1 in the “post__in” argument

    https://wordpress.stackexchange.com/questions/32902/display-all-posts-in-a-custom-post-type-grouped-by-a-custom-taxonomy