I am having trouble with a custom Wordpress / ACF loop I am working on.
The idea is that it displays the latest posts within the 'events' post type, hiding any posts where the event date has passed.
The posts do hide if the date has passed. However the loop is not displaying the full amount of posts available. Currently with the loop below, it is only showing 6 out of the available 10.
I have checked the reading settings in Wordpress and that's fine.
The code I am using for my loop is:
<ul class="events-list">
<?php
$loop = new WP_Query( array(
'post_type' => 'events',
'posts_per_page' => -1,
'orderby' => 'meta_value',
'order' => 'ASC',
'meta_type' => 'DATE',
'meta_key' => 'event-date'
));
while ( $loop->have_posts() ) : $loop->the_post();
$today = date('dmY');
$expire = get_field('event-date');
if( $expire > $today )
{ ?>
<li>
<h3><?php the_field('event-date'); ?> - <?php the_title(); ?></h3>
<span class="time"><?php the_field('event-time'); ?></span>
<?php the_field('event-details'); ?>
</li>
<?php; } endwhile; wp_reset_query(); ?>
</ul>