I made some meta_values under a custom post type called ‘Show’. I have confirmed that the meta values are being stored correctly in the DB. So now, I have the following code snippet:
<?php
$args = array( 'post_type' => 'show', 'posts_per_page' => 1 );
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post();
print get_post_meta($loop->ID, 'date_meta', true);
the_title();
endwhile;
?>
The actual loop works wine, as it does display the result of the_title(). But the get_post_meta() isn’t returning anything. The key value is correct, and there is a value for it in the DB.
Also, if I try to print $loop->ID, it doesn’t return anything either…
thoughts?
needed to add a reference to the global $post variable: