I’m using some php I found in the forums to show past events on a page on my site. It is working great but I would like to have them sorted with newest first. I found a thread on that telling what to add but I don’t know exactly where in the php to add it as I know minimal about it.
This is the php I found…
<?php
global $wpdb;
$tablename = $wpdb->prefix . events_detail;
$pastevents = $wpdb->get_results(“SELECT * FROM $tablename WHERE start_date < curdate() AND event_status <> ‘D’ “);
foreach ( $pastevents as $pastevent ){
echo ‘id) . ‘”>’ . stripslashes($pastevent->event_name) . ‘‘;
}
?>
And this is what I found to add…
ORDER BY date(start_date) DESC
Just not sure where or exactly how to add. Slowly learning this stuff π
The support post ‘"Order by" for past events’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.