Can’t use two loops on one page
-
<?php $my_query = new WP_Query('category_ID=3&showposts=2'); ?> <?php while ($my_query->have_posts()) : $my_query->the_post(); $do_not_duplicate = $post->ID; ?> <?php endwhile; ?>
Divs divs.
<?php $my_query = new WP_Query('category_ID=1&showposts=1'); ?> <div class="posts"><?php if(have_posts()) : ?><?php while ($my_query->have_posts()) : $my_query->the_post(); ?> Content content <?php endwhile; ?> <div class='navigation'> <?php posts_nav_link(); ?> </div> <?php endif; ?>
Only the second group of posts (category 1, which is Uncategorized) is displaying on the page.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Can’t use two loops on one page’ is closed to new replies.