Output posts separated by category
Output posts separated by category – Example using a Team and Team Category
Preview
Executive Team
Jane DoeJohn Smith
Management
Tom JohnsonAngie Mark
Engineering
Jill MitchellGeorge Jackson
Template
<Loop type=taxonomy_term taxonomy=team_category orderby=menu_order>
<h2><Field title /></h2>
<Loop type=post post_type=team_member taxonomy=team_category terms="{Field id}">
<Field title />
</Loop>
</Loop>
Team CPT (team_member), and Team Category (team_category) – Separated sections by their categories
Note: In this case, the order of the taxonomy matters, so we will use a plugin to set menu order of team_category and use orderby=menu_order to respect that order instead of just outputting it in the default alphabetical order