I have a taxonomy called Staff
and a term called Professores
, I created the taxonomy-staff.php
page to display all the teachers contained in the staff
and taxonomy-staff-professor.php
taxonomy to display the teachers registered with the term teacher , but it is not displaying the page, it even obeys the route and changes the page title, but the content does not appear. Can anyone help me?
follow the link from taxonomy-stafftax-professor.php
<?php
get_header();
get_template_part( 'wp-files/partials/banner' );
?>
<div class="content">
<h3>Perfis dos professores</h3>
<?php
$args = array(
'posts_per_page' => -1,
'post_type' => 'staff',
'post_status' => 'publish',
'tax_query' => array(
array(
'taxonomy' => 'stafftax',
'field' => 'slug',
'terms' => 'professor',
)
)
);
$loop = new WP_Query( $args );
if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post();
$terms = get_the_terms( $post->ID, 'stafftax');
?>
<ul>
<li>
<a href="<?php echo get_permalink(); ?>">
<?php echo get_the_title(); ?>
</a>
</li>
</ul>
<?php
endwhile;
endif;
wp_reset_query();
?>
<?php get_footer() ?>