Calling the loop twice from my own pages – breaks
-
I have the following code in my page. If I remove the first loop the 2nd works. If I leave the first loop in, the 2nd loop seems to evaluate as having ‘no posts’. Any idea why?
I am trying to simple list out in seperate sections 2 of the categories of my blog.
<?php $posts = get_posts('numberposts=10&category=12'); ?><br />
<?php if (have_posts()) : while (have_posts()) : the_post(); ?><span id="bdate"><?php the_date('','',''); ?></span><br />
<span id="btime"><?php the_time() ?></span><blockquote>
<div class="post" id="post-<?php the_ID(); ?>"><br />
<div class="storytitle"><?php the_title(); ?></div><div class="storycontent"><br />
<?php the_content(__('(more...)')); ?><br />
</div><div class="feedback"><br />
<?php wp_link_pages(); ?><br />
</div><br />
</div><br />
<?php comments_template(); // Get wp-comments.php template ?></blockquote>
<?php endwhile; else: ?><br />
<?php _e('Sorry, no posts matched your criteria.'); ?><?php endif; ?>
<?php $posts = get_posts('numberposts=10&category=8'); ?><br />
<?php if (have_posts()) : while (have_posts()) : the_post(); ?><span id="bdate"><?php the_date('','',''); ?></span><br />
<span id="btime"><?php the_time() ?></span><blockquote>
<div class="post" id="post-<?php the_ID(); ?>"><br />
<div class="storytitle"><?php the_title(); ?></div><div class="storycontent"><br />
<?php the_content(__('(more...)')); ?><br />
</div><div class="feedback"><br />
<?php wp_link_pages(); ?><br />
</div><br />
</div><br />
<?php comments_template(); // Get wp-comments.php template ?></blockquote>
<?php endwhile; else: ?><br />
<?php _e('Sorry, no posts matched your criteria.'); ?><?php endif; ?>
- The topic ‘Calling the loop twice from my own pages – breaks’ is closed to new replies.