I have my page setup with the typical <?php if(have_posts()) : while(have_posts()) : the post() ?><?php endwhile; endif; ?> but I have a two DIV's inside this loop that needs to alternate. How could I do this with as little as code as possible.
I have my page setup with the typical <?php if(have_posts()) : while(have_posts()) : the post() ?><?php endwhile; endif; ?> but I have a two DIV's inside this loop that needs to alternate. How could I do this with as little as code as possible.
Current code. I want to show 2 posts per row.
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<div class="posts">
<div class="row">
<div class="first">
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
</div>
<div class="second">
<h2><?php the_title(); ?></h2>
<?php the_content(); ?>
</div>
</div>
</div>
<?php endwhile; endif; ?>This topic has been closed to new replies.