I have a global post query running, but for some reason my custom meta is not being output. When I try to call it inside a typical WordPress loop it works, but not in my code below. Is there any reason why this would be the case? Been trying to figure it out for an hour now….
<?php global $post; $cntr = 0; $myposts = get_posts('&post_type=go-deeper&posts_per_page=12');
foreach($myposts as $post) : setup_postdata($post);?>
<li class="<?php echo "slide_" . $cntr; ?>"><a href="<?php echo get_post_meta($post->ID, 'll_deeper_link', true); ?>"><?php the_post_thumbnail('full'); ?></a></li>
<?php $cntr++; ?>
<?php endforeach; ?>
I just re-wrote the query and it works now: