Support » Fixing WordPress » How to group and order results by a taxonomy

  • Hi,

    I’ve create a custom post type for a company directory listing, with two custom taxonomies. The first taxonomy is a list of business categories and the second taxonomy is a package type i.e. “basic”, “plus” ,”premium” etc.

    I’m trying to figure out how I can filter the results of the first taxonomy so that they are grouped by the second taxonomy. For instance if you were viewing a page of results for “Roofing” they would be grouped so that listings whose “package type” was categorized as “premium” would be listed first, followed by “plus” and then “basic”.

    Is this possible? Or is this even the right way to handle it?

    Any advice would be greatly appreciated. Thank you.

Viewing 1 replies (of 1 total)
  • Thread Starter madfatter

    (@madfatter)

    Some previous research suggested that the best way to handle something like this would be to use meta values for the “package types” instead of taxonomies but I’m not clear on how I’d set the priority. Would it make sense to have multiple queries one after the other? Filtered by “premium” first and then the next query group filtered by “plus” etc.? That feels sloppy to me but it’s all I can think of.

Viewing 1 replies (of 1 total)
  • The topic ‘How to group and order results by a taxonomy’ is closed to new replies.