I'm having a problem where after I have ran a while loop to get my thumbnail images my advanced custom fields that run after the loop don't display.
I'm assuming the fix is similar to here Stackoverflow question However I cant for the life of me work it out.
Here's the section with the loop. I'm using it inside a div so I can change the background of the div.
Anyone know the problem?
gist here
<section id="portfolio">
<h3>Projects</h3>
<div class="card-container">
<?php global $query_string;
query_posts ('posts_per_page=3');
while(have_posts()) : the_post(); ?>
<div class="outer">
<div class="target">
<div class="card">
<div class="front">
<div class="thumbnail" <?php
if ( $id = get_post_thumbnail_id() ) {
if ( $src = wp_get_attachment_url( $id ) )
printf( ' style="background-image: url(%s);"', $src );
}
?>>
</div>
<h5><?php the_title(); ?></h5><?php the_excerpt('Read More'); ?>
<a href="#" class="btn btn-front hide-desk">View Site</a>
</div>
<div class="back">
<h5><?php the_title(); ?></h5>
<hr>
<p class="return"><?php the_content() ?></p>
<a href="#" class="btn btn-small">View Site</a>
</div>
</div>
</div>
</div>
<?php endwhile; ?>
<a href="#" class="btn">View More</a>
</div>
</section>