how to display category post only
-
I am working on coding a wp site. I have a box at the top of the page with three tabs
1.current projets
2.future projects
3.what’s in my blogWhat I want is to be able to post to a category and have it show up only in the box and not in the front page or home page. So in the div for current projects, I have this
<ul> <?php $recent = new WP_Query("cat=24&showposts=10"); while($recent->have_posts()) : $recent->the_post();?> <li><a href="<?php the_permalink() ?>" rel="bookmark"> <?php the_title(); ?> </a></li> <?php endwhile; ?> </ul>
The idea is to paste that in the future projects and the what’s in my blog category. I wanted the post title as well as the excerpt(). But it’s posting to the homepage as well as a normal post. How do I get it to just post to the category? Do you have better code than what’s above?
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘how to display category post only’ is closed to new replies.