Template taxonomy-{taxonomy}.php doesn’t show my posts

I have a simple issue that can’t solve.

I have a Custom Post Type called “Hardware” and inside a taxonomy called “hardware_category”. Im trying to show archive of each term with the file taxonomy-hardware_category.php but doesn’t return me any result (it should display 5 posts).

Anything special to consider in my template?

Thanks!

<?php

// File: taxonomy-hardware_category.php

get_header();
$term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) );
?>

<div class=”main”>

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>

<div class=”product”>
<?php the_post_thumbnail(‘full’); ?>
<?php the_title(); ?>
</div>

<?php endwhile; ?>
<?php endif; ?>

</div>

<?php get_footer(); ?>

Read more here:: Template taxonomy-{taxonomy}.php doesn’t show my posts

Leave a Reply

Your email address will not be published. Required fields are marked *