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.
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!
© 2023 Advanced Custom Fields.