Send variables to template

// in archive, taxonomy
<?php $tax = 'news_tax'; ?>
<ul class="uk-margin-medium-bottom uk-margin-medium-top uk-grid-match uk-child-width-1-3@m uk-child-width-1-2@s uk-grid-small" uk-grid="">
  <?php while($i->have_posts()): $i->the_post(); ?>
  <?php if($i->current_post > 0): ?>
  <!-- <loopCardPrimary>-->
  <?php set_query_var('tax', $tax); ?>
  <?php echo get_template_part('partials/loops/card-primary'); ?>
  <!-- </loopCardPrimary>-->
  <?php endif; ?>
  <?php endwhile; wp_reset_postdata(); ?>
</ul>
    
// in loop template
<?php $tax = get_query_var('tax'); ?>