Forum
Past events continue to appear
Past events are not shown by default, to my knowledge. On a site I'm doing some maintenance for, there's a listing of upcoming events on the homepage using this array:
<?php
$opts = array(
'past-events'=>false,
'category'=>array('events'),
'sort'=>'eventDateTime',
'sort-order'=>'asc',
'template'=>'events/listing/event-day.html'
);
perch_events_custom($opts);
?>
The past events are showing, which is confusing the site's visitors. Here's the template for that area:
<perch:before>
<ul>
</perch:before>
<li>
<h5><span class="day"><perch:events id="eventDateTime" format="l, jS F Y" /></span></h5>
<span class="time dtstart"><span class="value-title" title="<perch:events id="eventDateTime" format="c" />"> <perch:events id="eventDateTime" format="%l:%M %p" /></span> - </span>
<span class="event summary <perch:events id="category_slugs" />"><a href="<perch:events id="eventURL" />"><perch:events id="eventTitle" /></a></span>
<div class="description">
<perch:events id="eventDescHTML" encode="false" />
</div>
</li>
<perch:after>
</ul>
</perch:after>
What's going on with it?
the past-events filter is for the standard functions. You are using perch_events_custom so will need to filter what you show yourself (as is usual for any custom function). The docs are here: https://docs.grabaperch.com/docs/events/page-functions/custom/
You need to filter it via the date. i.e
Ah. So to make sure I'm understanding this properly, the above array will filter the events listing to include events that take place on a day that is either today or in future, correct?
That's right.