$series_id,
'posts_per_page' => 1,
'post_type' => 'comic',
'order' => $collection_comic_order,
"tax_query" => array(
array(
'taxonomy' => "collections", // use the $tax you define at the top of your script
'field' => 'term_id',
'terms' => $collection->term_id, // use the current term in your foreach loop
),
),
'no_found_rows' => true,
'update_post_meta_cache' => false,
'update_post_term_cache' => false,
);
$first_comic_query = new WP_Query($args);
// The Loop
while ($first_comic_query->have_posts()): $first_comic_query->the_post();
$link_to_first_comic = add_query_arg(array('sid' => $series_id, 'col' => $collection->term_id), get_post_permalink());
wp_reset_postdata();
printf(wp_kses_data('%1$s'), '
';
endwhile;
$counter++;
} //end foreach
// Reset Post Data
wp_reset_postdata();
?>