Support

Account

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