The Loop in Archive.php (1 post)

  1. Dunkkan
    Posted 6 years ago #

    Hello guys,

    I have this loop in Archive.php :

    	if (have_posts()) : ?>
    	<?php while (have_posts()) : the_post(); ?>
    	// code, stuff, more code
    	<?php endwhile; ?>
    	<?php else : ?>
    	// code, stuff, more code
    	<?php endif; ?>

    Inside that loop, I'm assigning to every div containing a post it's post's ID.

    <div id="<?php the_ID(); ?>">
    	//title, content, tags

    Later, I need, again, the same pack of IDs outside the loop.

    My question is : how can I call TWICE for the same loop ?
    Or :
    Can I store anywhere the id's in the first loop, then echo them anywhere else, without needing a second loop ?

    How would you do that ?

    Many thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic