Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created June 24, 2014 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/119c6fdab12daf7f5b64 to your computer and use it in GitHub Desktop.
Save joshfeck/119c6fdab12daf7f5b64 to your computer and use it in GitHub Desktop.
This code can be placed within a page template to display a list of events. Requires Event Espresso 3.
<ul class="course-list">
<?php
if( function_exists( 'espresso_reg_url' )) {
global $wpdb;
$tablename = EVENTS_DETAIL_TABLE;
$courses = $wpdb->get_results("SELECT * FROM $tablename WHERE start_date >= '" . date('Y-m-d') . "' AND event_status <> 'D' ORDER BY start_date ");
foreach ( $courses as $course ){
echo '<li><a href="' . espresso_reg_url($course->id) . '">' . stripslashes($course->event_name) . '</a></li>';
}
}
?>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment