How to pass current loop data into nested loop

What you’ve done with the variable is correct (defining it before starting the next loop), but you’re not outputting it correctly:

<p>current post = <?php $current_page; ?></p>

If you want to output $current_page to the screen, you need to echo it:

<p>current post = <?php echo $current_page; ?></p>