How do I show only one Category on an Archive page?
-
Hi there. I’m editing my Archive.php page (Yes, got backups and child themes and everything, so don’t worry about any of that) but I can’t work out how to show only one Category (category 5, by the way)
Here’s my current code. Can anyone show me exactly how to make it so it only shows results from category 5?
get_header(); ?> <?php /* The loop */ ?> <div class="left-column"> <?php while ( have_posts() ) : the_post(); ?> <div class="social-main-content"> <h3 class="h3-title"><?php if ( is_day() ) : printf( __( 'Daily Archives: %s', 'twentythirteen' ), get_the_date() ); elseif ( is_month() ) : printf( __( 'Monthly Archives: %s', 'twentythirteen' ), get_the_date( _x( 'F Y', 'monthly archives date format', 'twentythirteen' ) ) ); elseif ( is_year() ) : printf( __( 'Yearly Archives: %s', 'twentythirteen' ), get_the_date( _x( 'Y', 'yearly archives date format', 'twentythirteen' ) ) ); else : _e( 'Archives', 'twentythirteen' ); endif; ?> </h3> <div class="inside"> <?php the_content(); ?> </div> </div> <?php endwhile; ?> </div>
Thanks!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘How do I show only one Category on an Archive page?’ is closed to new replies.