multiple queries on one page?
-
Hi, I’m building a template that has a category, sub-category and post excerpts in the side bar. I created the part of the sidebar that lists the excerpt of the current category like so
<?php query_posts("cat=$cat"); ?>
<?php while (have_posts()) : the_post(); ?>
<a href="<?php the_permalink() ?>" class="more"> <?php the_excerpt(); ?></a>
<?php endwhile; ?>
</li>
It was working fine as long as I didn’t do anything to the main query on the page. But now I only want to show the most recent post on the category page so I put this line at the top of the main file
<?php query_posts("showposts=1"); ?>
and now the side bar doesn’t work. Is there a way to make the two queries not conflict with one another?
- The topic ‘multiple queries on one page?’ is closed to new replies.