one post from a specific category
-
Hello,
I am using this code, but the code is returning all the posts even though I have specified showposts=1. I am using the code on index page. What am I doing wrong here.
<ul> <?php $recent = new WP_Query("showposts=1&cat=3"); while($recent->have_posts()) : $recent->the_post();?> <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li> <?php endwhile; ?> </ul>
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘one post from a specific category’ is closed to new replies.