Home › Forums › ACF PRO › Get Next Post › Reply To: Get Next Post
Updated code, but still not record displaying:
<?php if(get_field('tradeshows', 40) ): ?>
<div class="trades container">
<?php
// vars
$current_event_date = get_sub_field('event_date');
$next_event_query = new WP_Query(array(
'post_type' => 'events',
'post_status' => 'publish',
'posts_per_page' => -1,
'meta_query' => array(
array(
'key' => 'event_date',
'compare' => '>',
'value' => $current_event_date,
'type' => 'DATE'
)
),
'orderby' => 'meta_value',
'order' => 'ASC'
));
$rows = get_field('tradeshows', 40);
//$tradeshowsdate = get_sub_field('event_date', 40);
$tradeshowslocation = get_sub_field('event_location', 40);
?>
<?php if ($next_event_query->have_posts()) while ($next_event_query->have_posts()): $next_event_query->the_post(); ?>
<div class="col-sm-3">
<h3>NEXT TRADESHOW</h3>
<p><?php echo $current_event_date; ?></p>
</div>
<?php endwhile; ?>
<?php endif; ?>
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.