Home › Forums › General Issues › Images on page are the same as in the posts loop › Reply To: Images on page are the same as in the posts loop
Hi @fanta00
Please add your code using the code tag so it shows properly. Regarding your issue, I believe you can do something like this:
$wp_query = new WP_Query($args);
?>
<?php while ( $wp_query->have_posts() ) : $wp_query->the_post(); ?>
<?php $top_post_banner = get_field('top_banner', get_the_ID()); ?>
<img src="<?php echo $top_post_banner['sizes']['medium']; ?>" alt="<?php echo $top_post_banner['alt']; ?>" />
<?php endwhile; ?><!– end of the loop –>
<?php wp_reset_query(); ?>
I hope this helps.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.