Need two posts in the while loop, not just one.
-
Here’s what I have:
<?php query_posts( 'tag=featured&orderby=modified&order=ASC' ); $inc = 0; while ( have_posts() ) : the_post(); $inc++; ?> <li><a href="#slide<?php echo $inc; ?>" id="slide<?php echo $inc; ?>"><?php echo $inc; ?></a> <?php endwhile; wp_reset_query(); ?>What I’d like it to output is:
<li> <h3>Article Title</h3> <p>Article summary</p> <h3>Article Two Title</h3> <p>Article Two summary</p> </li>How can I get the while loop to output one set of li tags around two posts?
What I need is to have each set of two posts as a slide in a javascript slider. Each time the user clicks the arrow to move the slider, a new set of two appears.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Need two posts in the while loop, not just one.’ is closed to new replies.