loops inside the loop
-
i want my loop to display 4 posts, then echo </div><div class=small4″>
until there is no more posts. for now, it works only one time.my code:
<div class="small4"> <?php $split = ceil( count($posts) / 4 ); ?> <?php if (is_category('photos1')) {query_posts ('category_name=photos1');} ?> <?php if (have_posts()) : while (have_posts()) : the_post(); if( $post->ID == $do_not_duplicate ) continue; update_post_caches($posts); ?> <div class="post" id="post-<?php the_ID(); ?>"> <div class="entry"> <?php the_content(''); ?> </div> </div> <div class="spacer"></div> <?php if( $post == $posts[$split] ) : echo "</div><div class=\"small4\">" ?> <?php endif; ?> <?php endwhile; endif; ?> </div>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘loops inside the loop’ is closed to new replies.