I found an easy solution. Replacing
<?php get_template_part ( 'loop') ?>
with
<?php include( locate_template( 'loop.php', false, false ) ); ?>
did the trick. I could just use the variable as I usually would. Code and answer from mekshq.com.
I found an easy solution. Replacing
<?php get_template_part ( 'loop') ?>
with
<?php include( locate_template( 'loop.php', false, false ) ); ?>
did the trick. I could just use the variable as I usually would. Code and answer from mekshq.com.