Event display ignoring events with times
-
We have three events displayed on the home page of the site which are ordered to date ascending (so to display the next three dates) but it looks like the code ignores any events where there’s a time entry for the date so the only events displayed are those where a time is missing. So we get three events in ascending order but not necessarily the next three events.
Here is the code that displays the events. Have I missed something?
<div class="events_section"> <div class="wrapper"> <div class="events_inner"> <?php $args = array( 'posts_per_page' => 3, 'offset' => 0, 'category' => '', 'orderby' => 'event_date', 'order' => 'ASC', 'include' => '', 'exclude' => '', 'meta_key' => '', 'meta_value' => '', 'post_type' => 'event', 'post_mime_type' => '', 'post_parent' => '', 'post_status' => 'publish', 'suppress_filters' => true ); ?> <?php $posts_array = get_posts( $args ); //echo '<pre>'; //print_r($posts_array); ?> <?php foreach($posts_array as $event) {?> <div class="events_blk"> <div class="events_blk_inner"> <h2><?php echo $event->post_title; ?></h2> <h4><?php the_field('event_date', $event->ID);?></h4> <p><?php echo wp_trim_words( $event->post_content,20) ?></p> <a>ID); ?>">More info here.</a> </div> </div> <?php }?> <p>*Like to schedule an author event at your school, library, bookstore, or conference? <a>/author-visits/">Visit this page</a>.</p> </div>
The page I need help with: [log in to see the link]
Viewing 12 replies - 1 through 12 (of 12 total)
Viewing 12 replies - 1 through 12 (of 12 total)
- The topic ‘Event display ignoring events with times’ is closed to new replies.