while ( $query->have_posts() ) : $query->the_post();
$currentID = get_the_ID();
while ( $events_list->have_posts() ) :
$events_list->the_post();
$postdate = get_the_date('Y-m-d');
$currentdate = date('Y-m-d');
if ($postdate > $currentdate) {
$i++;
}
endwhile;
// preferrably store the total of $i here in a unique variable then reset $i
the_content();
endwhile;