If I add this piece of code to index.html to display some of the posts, it removes all other ACF tasks down the page.
<?php
$args = array(
'post_type' => 'referentie',
'posts_per_page' => 3
);
$cpt_query = new WP_Query($args);
if ($cpt_query->have_posts()) : while ($cpt_query->have_posts()) : $cpt_query->the_post(); ?>
<div class="col-xs-12 col-md-4 col-lg-4">
<a class="project-thumbnail-tekst" href="<?php the_permalink(); ?>">
<div class="project-thumbnail">
<div class="project-thumbnail-img zoomin blauw">
<div class="project-thumbnail-holder">
<img class="project-thumbnail-image" src="<?php
$images = get_field('ref_gallerij');
if( $images ):
$eerste = true;
foreach( $images as $image ):
if ($eerste) {
echo $image['sizes']['large'];
$eerste = false;
}
endforeach;endif; ?>" alt="">
<div class="hi-icon-wrap hi-icon-effect-5 hi-icon-effect-5d deterinkbuttonposition2">
<span id="academyiconright2" class="icon hi-icon" style="padding-top: 10px;"><img src="<?php bloginfo('template_directory');?>/images/arrow-cta.svg" class="icon"></span>
</div>
</div>
<div class="project-thumbnail-block">
<h2 style="text-align: center;"><?php the_field('project_naam'); ?></h2>
</div>
</div>
</div>
</a>
</div>
<?php endwhile; endif; ?>
Is something wrong with this code that it removes the other tasks?
Thank you!