postnum, css and loop dilemna
-
I am using the following code to display the image links of the five most recent additions. I’ve got two problems. First, because the post number occurs after the loop is started, I’m having a hard time situating my divs.
<?php while (have_posts()) : the_post(); ?>
<?php if ( $i < 6 ) { ?>
Then float images from first five posts.
<?php } elseif ( $i > 5 ) { ?>
Then display the rest of the posts in a different format.
<?php } ?>
<?php $i=$i+1; ?>
<?php endwhile; ?>
There needs, I think, to be a containing box for the floating divs for the first five posts, but when I put the div outside of the loop, it affects the ones after 5. If I put the div inside the loop, affecting only the individual posts, then I have an issue with the containing div encompassing individual posts and not the entirety of the first five.
This is best illustrated by the “date” category where I wan t the first five to display inline (although I used div floats instead of inline lists) and the ones after 6 to appear in a list format. I can’t figure out where to put the
<ul>
.Is there a way to put the pagenum outside the loop?
- The topic ‘postnum, css and loop dilemna’ is closed to new replies.