show all posts within category
-
I am currently using this code in single.php:
<?php $temp_query = $wp_query; ?>
<?php query_posts('cat=3&showposts=100'); ?>
<?php while (have_posts()) : the_post(); ?>
<li class="static"><a>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a>
<?php endwhile; ?>
<?php $wp_query = $temp_query; ?>
However, I need this to be dynamic for each of my three categories, but it’s defined in the loop as “cat=3”. I am using this code to return the category id:
<?php echo get_query_var( ‘cat’ ); ?>
Is there a way to merge the two pieces and build a piece of code that will check the category and then return only the posts in that category?
Thanks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘show all posts within category’ is closed to new replies.