Won’t look for category.php or archive.php
-
When I click on a category, the page seems to skip over “archive.php” and chooses “index.php” so I always see the exact same homepage when I choose a category. I cleared archive.php just to make sure it was being ignored, and the same thing happened.
I made this blog a few days ago and am working with a theme (made by someone else; http://wpjunction.com/magazine/) I just went to the theme demo page and realized that even the demo page has the same problem, so I am not sure where to go from here. This is what archive.php looks like, straight from the theme pack:
<?php /** * ProMag Theme * Designed by HPA * Coded by misbah (ini_misbah@yahoo.com) */ get_header();?> <div id="content"> <?php if (have_posts()) : ?> <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?> <?php /* If this is a category archive */ if (is_category()) { ?> <h2 class="pagetitle">Archive for the ‘<?php single_cat_title(); ?>’ Category</h2> <?php /* If this is a tag archive */ } elseif( is_tag() ) { ?> <h2 class="pagetitle">Posts Tagged ‘<?php single_tag_title(); ?>’</h2> <?php /* If this is a daily archive */ } elseif (is_day()) { ?> <h2 class="pagetitle">Archive for <?php the_time('F jS, Y'); ?></h2> <?php /* If this is a monthly archive */ } elseif (is_month()) { ?> <h2 class="pagetitle">Archive for <?php the_time('F, Y'); ?></h2> <?php /* If this is a yearly archive */ } elseif (is_year()) { ?> <h2 class="pagetitle">Archive for <?php the_time('Y'); ?></h2> <?php /* If this is an author archive */ } elseif (is_author()) { ?> <h2 class="pagetitle">Author Archive</h2> <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> <h2 class="pagetitle">Blog Archives</h2> <?php } ?> <?php while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2 class="title"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2> <div class="meta"> <p> <span class="datepost"><?php the_time('l, F jS, Y') ?></span> <span class="commented"><?php comments_number('No Commented','one Commented','% Commented'); ?></span> </p> <p> <span class="tagpost"><?php the_tags( 'Under : ', ', ', ''); ?></span> </p> </div> <div class="entry"> <?php the_content(); ?> </div> </div> <?php endwhile; ?> <?php else : ?> <?php get_search_form(); endif; ?> <div class="clear"></div> </div><!-- /content --> <?php get_sidebar(); get_footer(); ?>Is there something I can put into index.php to force it to recognize archive.php when I choose one category?
The topic ‘Won’t look for category.php or archive.php’ is closed to new replies.