Last active
December 16, 2015 10:29
-
-
Save joshfeck/5420669 to your computer and use it in GitHub Desktop.
Displays a list of events that started before today's date. Can be placed into a page template or within a widget template. Requires WP + Event Espresso.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<?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 '<li><a href="' . espresso_reg_url($pastevent->id) . '">' . stripslashes($pastevent->event_name) . '</a></li>'; | |
} | |
?> | |
</ul> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment