Forum

Thread tagged as: Events

perch_events_listing() will only output past events

Hi All,

I had the plugin installed and all working on local dev environment on Friday, but on return to work this morning this function no longer seems to output (future) events.

<div class="events-widget__inner">
      <?php perch_events_listing(); ?>
</div>

This however does output past events...

 <?php
     perch_events_listing(array(
     'past-events'        => true,
     ));
 ?>

I can see both future and past events in the Perch admin. First time with Perch so apologies if it's an obvious one!

Thanks,

Pete

Chris James

Chris James 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Obviously the current date has changed since last Friday, but has anything else?

What dates are on your events?

I'm 99% sure I didn't change anything! Possibly got muddled up with the templates but have it working now using:

            <div class="events-widget__inner">
            <?php 
                perch_events_custom(array(
                    'filter'=>'eventDateTime',
                    'match'=>'gte',
                    'value'=>date('Y-m-d'),
                    'count'=>3,
                    'sort'=>'eventDateTime',
                    'sort-order'=>'desc',
                    'template'=>'listing/events-widget.html'
                ));
            ?>
            </div>

Thanks for the speedy reply.

Pete