Home › Forums › Front-end Issues › ACF URL Field on Index Page WP Query › Reply To: ACF URL Field on Index Page WP Query
If you are trying to get the field from the current post in the loop then all you need to do is move that line to inside the loop
$args = array( 'posts_per_page' => 8 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
$variable = get_field('link', $post->ID);
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.