Get posts from custom tax grouped by terms (MySQL)