Issue With query_posts()?
-
I’m trying to display all the posts from a particular category.
This is the current code:
query_posts( 'cat=news' ); if (have_posts()) : while (have_posts()) : the_post(); ?> <a href="<?php the_permalink() ?>" style="font-size: 20px;"><?php the_title(); ?></a> <?php the_excerpt() ?> <?php endwhile; endif; ?>
news is the category slug. When using this code it’s returning every post, not the posts in that particular category. Anyone know what I’m doing wrong?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Issue With query_posts()?’ is closed to new replies.