I would re-read the standard loop example from https://codex.www.ads-software.com/Class_Reference/WP_Query#Standard_Loop because it looks like you missed some details.
Specifically, you’re missing parts of the following:
if ( $the_query->have_posts() ) {
echo '<ul>';
while ( $the_query->have_posts() ) {
$the_query->the_post();
echo '<li>' . get_the_title() . '</li>';
}
echo '</ul>';
} else {
// no posts found
}
/* Restore original Post Data */
wp_reset_postdata();
Notice how they’re doing things like $the_query->have_posts()
and whatnot. That’s making the code act on this new WP_Query object. In your case, it’d be the taxonomy query you’re making. With what you have above, your use of the_permalink()
and other familiar loop functions are acting on the WP_Query object for the page you’re on.
Hopefully something like the following gives you the results you’re wanting.
<div class="container-fluid section-with-search section-dark">
<div class="row mm-grid">
<?php
$the_query = new WP_Query( array(
'post_type' => array('video-index'),
'tax_query' => array(
array(
'taxonomy' => $term->taxonomy,
'field' => 'slug',
'terms' => $term->slug,
),
),
) );
if ( $the_query->have_posts() ) :
?>
<ul class="post-list">
<?php
while( $the_query->have_posts() ) :
$the_query->the_post();
<li>
<a class="post-title" href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
<?php if ( has_post_thumbnail() ) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_post_thumbnail(); ?>
</a>
<?php endif; ?>
</li>
</ul>
<?php endwhile; endif;
/* Restore original Post Data */
wp_reset_postdata();
?>
</div>
</div>