We are transitioning over to a new forum platform. Please post new issues there. Existing threads will be dealt with here unless you choose to move them over. Visit the new forum

Forum

Thread tagged as: Events

Past events and controlling their order

Hi

I'm wanting to show all the past events on a main events page. I can get all the past events to display but there's no way to control their order. At the moment they are displaying the earliest past event through to the most recent past event I would like them to be displayed with the most recent past event first and then the earliest posted past event.

My code for this is below but doesn't seem to be sorting them at all.

<?php 
perch_events_custom(array(
'filter'=>'eventDateTime',
'match'=>'lt',
'value'=>date('Y-m-d'),
'count'=>90,
'sort'=>'eventDateTime',
'sort-order'=>'desc',
'template'=>'listing/custom-listing-day.html'
));
?>

Thanks

Peter Meenagh

Peter Meenagh 0 points

  • 2 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Try:

'sort' => 'eventDateTime', 
'sort-order' => 'DESC',

That did it thanks Drew the lower case desc was the issue.