Set specific categories to display in WordPress’ date archive

Simply place a value to the query_string to select specific categories before the loop begins.
<?php query_posts($query_string . '&cat=5'); ?>

In the above example this would select category ID 5.

Below I have set the query to look at a category slug named press-relase.

<?php if ( have_posts() ) : ?>

<?php query_posts($query_string . '&category_name=press-release'); // Pull only date results from the slug 'press-release' ?>

<?php /* Start the Loop */ ?>

<?php while ( have_posts() ) : the_post(); ?>

<?php get_template_part( 'excerpt', get_post_format() ); ?>

<?php endwhile; ?>

<?php else : ?>

<?php get_template_part( 'content', 'none' ); ?>

<?php endif; // end have_posts() check ?>

For more information

Comments

Your email address will not be published. Required fields are marked *