This is based on the assumption that you have a custom field called “show_on_tax” for the custom taxonomy “Directory Entry Type”, which appears when editing a small banner (See image below). This allows you to select which custom tax terms you want the banners to appear on. This should get you sorted but drop a comment if not.
<?php
// taxonomy-directory_entry_type.php template file
// Get currently viewed term id
$term_id = get_queried_object()->term_id;
// Get all banners with show_on_tax custom field matching to $term_id
$args = array(
'post_type' => 'small-banner',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'show_on_tax',
'value' => $term_id,
'compare' => 'LIKE'
)
)
);
// Create custom banner query
$banner_query = new WP_Query( $args );
// Check if anything is found and do the custom loop
if ( $banner_query->have_posts() ) : ?>
<div class="my-slider" style="width: 380px;">
<ul>
<?php while ( $banner_query->have_posts() ) : $banner_query->the_post(); ?>
<?php $photo = get_field( 'small_banner_image', get_the_ID() ); ?>
<li>
<a href="https://wordpress.stackexchange.com/questions/253773/<?php the_field("small_banner_image' ); ?>">
<img src="<?php echo $photo['url']; ?>" alt="<?php echo $photo['alt']; ?>">
</a>
</li>
<?php endwhile; ?>
</ul>
</div>
<?php
endif;
wp_reset_postdata();
?>