I have set up a category.php
according to this wordpress hierarchy diagram.
When I am on the page http://example.com/category/my-category I want to display all posts that are under my-category
using the loop:
<?php if (have_posts()): while (have_posts()): the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php endwhile; endif; ?>
Wordpress is not showing the posts. I will also add that this is a custom post type, but that shouldn't matter or should it?
I can use get_posts()
but then what is the point of having a category.php
?
How do I show the posts in the current category using the_loop
?