'WordPress not using category.php file for custom theme
I'm coding a WordPress theme on a staging site and I'm having an issue with having all of my posts display. I've set the static page for the blog to "News" in the setting > Reading option but when I go to the news page, the page is displaying using the index.php file instead of the category.php file that I have created. Template order should have index last if it can't find category or archive is my understanding.
I'm using the same coding on another site and it works correctly. I've put this new theme on that existing site and it works as it should. They are both on the same hosting company. I started a brand new WordPress instance and it's not working on that new instance either.
My template for page.php is working fine instead of defaulting to index.php
Also tried updating permalinks, checked file permissions, checked htaccess file for rewrite conditions.
So what am I missing?
category.php code
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content-posts', get_post_format() ); ?>
<?php endwhile; else : ?>
<?php get_template_part( 'template-parts/content', 'none' ); ?>
<?php endif; ?>
<?php echo paginate_links(); ?>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
