Is it possible to organize a list of repeating elements by a taxonomy? I created a list of the communities at the top of the page that links down to each community (repeating element). My client would like me to group them by a geographic term that I added to each one. The list should display like this:
This is the code I currently have that links down to the ID I added to each row. My question is can I group each community name by the different taxonomy terms?
$i = 1;
echo '<li><a href="' . get_permalink() . '#community-' . $i . '">' . get_sub_field('community_name') . '</a></li>' ;