You can use tax_query
to query your posts based on the taxonomy. But be advised, if you have a lot of categories, then this is gonna take a lot of resources, unless you use a cache plugin.
$terms = get_terms(array('taxonomy' => 'album', 'exclude' => 4));
foreach ($terms as $term){
$args = array(
'post_type' => 'simple_image',
'posts_per_page' => '1',
'order_by' => 'date',
'order' => 'ASC',
'tax_query' => array(
array(
'taxonomy' => 'album',
'field' => 'slug',
'terms' => $term->slug,
)
)
);
$new_query = new WP_Query ($args);
if ($new_query->have_posts()) {
while($new_query->have_posts()){
$new_query->the_post();
the_post_thumbnail('thumbnail');
}
}
wp_reset_postdata();
}
As you have already noticed, this will run 100 queries, if you have 100 terms under that taxonomy. So, make sure you use it in conjunction with a cache plugin.