taxonomy-staff-professor

HTML

<?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() ?>