You should use WP_Query()
instead of query_posts. You also don’t need a separate query to loop through for each one. Just use a WP_Query for the Featured category, limit it to 3 posts, and you should be good to go. It’s not necessarily optimized but I cobbled it together with your code sample.
This should get you started:
<?php
$per_page = 3;
$slideshow_query = new WP_Query( array(
'cat' => 1,
'posts_per_page' => $per_page,
) );
if( $slideshow_query->have_posts() ){
echo '<div class="slideshow-container">';
while ( $slideshow_query->have_posts() ) {
$slideshow_query->the_post(); ?>
<div class="mySlides fade">
<div class="numbertext"><?= $slideshow_query->current_post + 1; ?> / <?= $per_page ?></div>
<a href="https://wordpress.stackexchange.com/questions/295382/<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
<?php the_post_thumbnail( 'large' ); ?>
</a>
<div class="text"><?php the_title(); ?></div>
</div>
<?php } ?>
<a class="prev" onclick="plusSlides(-1)">❮</a>
<a class="next" onclick="plusSlides(1)">❯</a>';
</div>
<?php } else {
_e( 'Sorry, no posts matched your criteria.' );
}
?>
Update: with a recent edit it should be noted that
<?= $slideshow_query->current_post + 1; ?> / <?= $per_page ?>
is functionally equivalent to
<?php echo $slideshow_query->current_post + 1; ?> / <?php echo $per_page ?>
<?=
is known as the Short Echo Tag