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

Question

I have a simple issue that can’t solve.

I have a Custom Post Type called “Hardware” and inside a taxonomy called “hardware_category”. I’m trying to display a list of my custom posts in 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(); ?>
0
, , Sema Hernandez 4 years 2020-02-15T08:39:16-05:00 0 Answers 46 views 0

Leave an answer

Browse
Browse