Archive.php single category
-
Is there an easy way to make the archive.php only show a certain category? I currently have:
<?php if ( have_posts() ) : ?> <?php $my_query = new WP_Query('category_name=blog'); while ($my_query->have_posts()) : $my_query->the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php else : ?> Content? <?php endif; ?>
but it shows all posts from the blog category regardless of what part of the archive I’m on. So if I go to /2009/2/, I still see posts from 2010 and on.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Archive.php single category’ is closed to new replies.