Bootstrap Carousel HTML structure and funny output [closed]

You have a nested anchor tag. I have never seen that done before. You are wrote this with your code

 <a href="#"><a href="#"></a></div></div></a>   

I would think that is your problem. Why do you need this first anchor tag?

 ?php
while ($postsSlider->have_posts()) : $postsSlider->the_post(); 

if ($first) {
?>
  <a class="foto_link" href="https://wordpress.stackexchange.com/questions/290742/<?php the_permalink(); ?>">//should this be here

Take out that anchor tag and see what happens