Archive page isn't filtering content
-
I would like to use my archive.php template to display all of my archives, including my category, tags, posts, and custom post type archives. Currently the correct titles are displaying at the top of the pages, but the loop always shows my most recent posts and doesn’t filter them by category or tag. My custom post type archive is also displaying my most recent posts (regular posts, not custom post types posts). I am working behind a firewall so can’t post a link to the page. Here are the contents of my archive.php:
<?php get_header(); ?> <div id="site-hero"> </div> <div id="site-content"> <div class="container-fluid"> <div class="row"> <nav id="breadcrumbs" class="col-xs-12"> <?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb(); } ?> </nav> <div class="col-xs-12 col-sm-9"> <?php if (is_category()) { ?> <div class="content-title"> <h3><?php _e( 'Posts Categorized:', 'bonestheme' ); ?> <?php single_cat_title(); ?></h3> <div class="title-underline"></div> </div> <?php } elseif (is_tag()) { ?> <div class="content-title"> <h3><?php _e( 'Posts Tagged:', 'bonestheme' ); ?> <?php single_tag_title(); ?></h3> <div class="title-underline"></div> </div> <?php } elseif (is_author()) { global $post; $author_id = $post->post_author; ?> <div class="content-title"> <h3><?php _e( 'Posts By:', 'bonestheme' ); ?> <?php the_author_meta('display_name', $author_id); ?></h3> <div class="title-underline"></div> </div> <?php } elseif (is_day()) { ?> <div class="content-title"> <h3><?php _e( 'Daily Archives:', 'bonestheme' ); ?> <?php the_time('l, F j, Y'); ?></h3> <div class="title-underline"></div> </div> <?php } elseif (is_month()) { ?> <div class="content-title"> <h3><?php _e( 'Monthly Archives:', 'bonestheme' ); ?> <?php the_time('F Y'); ?></h3> <div class="title-underline"></div> </div> <?php } elseif (is_year()) { ?> <div class="content-title"> <h3><?php _e( 'Yearly Archives:', 'bonestheme' ); ?> <?php the_time('Y'); ?></h3> <div class="title-underline"></div> </div> <?php } ?> <div> <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <div class="post"> <?php the_post_thumbnail('thumbnail'); ?> <?php the_time('F j, Y') ?> | By <?php the_author(); ?> <h4><a href="<?php the_permalink() ?>"> <?php the_title(); ?></a></h4> <!-- <?php the_excerpt(); ?> --> <hr style="clear: both" /> </div> <?php endwhile; ?> <div class="pagination"> <?php fase_pagination(); ?> </div> <?php endif; ?> </div> </div> <div class="col-xs-12 col-sm-3"> <?php get_sidebar('right'); ?> </div> </div> <!-- /.navbar-collapse --> </div> </div> <?php get_footer(); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Archive page isn't filtering content’ is closed to new replies.