Two columns show only two posts
-
I have done two loops with different categories. The first loop shows the first category and the second loop shows the second category.
Each loop is a <div>
But I have a problem. The loops only show two posts. When there are more posts, the loop creates another <div> like the loop limit was two posts.
What’s wrong?
The code:
<div id="content"> <?php $theme->hook('content_before'); ?> <?php $is_post_wrap = 0; query_posts('category_name="Left Column"'); if (have_posts()) : while (have_posts()) : the_post(); $is_post_wrap++; if($is_post_wrap == '1') { ?><div style='width:300px;float:left;border:1px solid #BEBEBE;'><?php } get_template_part('post-columns', 'homepage'); if($is_post_wrap == '2') { $is_post_wrap = 0; ?></div><?php } endwhile; else : get_template_part('post', 'noresults'); endif; if($is_post_wrap == '1') { ?></div><?php } $is_post_wrap = 0; query_posts('category_name="Right Column"'); if (have_posts()) : while (have_posts()) : the_post(); $is_post_wrap++; if($is_post_wrap == '1') { ?><div style='width:300px;float:left;border:1px solid orange;'><?php } get_template_part('post-columns', 'homepage'); if($is_post_wrap == '2') { $is_post_wrap = 0; ?></div><?php } endwhile; else : get_template_part('post', 'noresults'); endif; if($is_post_wrap == '1') { ?></div><?php } get_template_part('navigation'); ?>
- The topic ‘Two columns show only two posts’ is closed to new replies.