Home › Forums › Front-end Issues › Field Values Not Showing in Custom Loop › Reply To: Field Values Not Showing in Custom Loop
You are running your code inside of a function. Are your sure that get_the_ID()
is returning the correct value in this context?
<?php if ( $query->have_posts()) : while ( $query->have_posts() ) : $query->the_post(); ?>
<div class="video-item">
<div class="video-image">
<?php
// see what get_the_ID() is returning
// make sure it's the same as the image
echo get_the_ID();
?>
<a href ="<?php echo( get_post_meta( get_the_ID(), 'video_live_url', true))?>" ><?php the_post_thumbnail(); ?></a>
also, you may need to add this line inside of your function, but I’m not sure, it’s just a guess.
global $post
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.