Skip to content

Instantly share code, notes, and snippets.

View davehightower's full-sized avatar

Dave Hightower davehightower

View GitHub Profile
@joshfeck
joshfeck / functions.php
Last active July 21, 2019 22:40
Past event archives page template for EE4. This can be adapted to most WP themes. Prints a simple unordered one page list of expired events.
<?php
// alter the query to only the primary datetimes that ended before today
// adjust query as desired
// add this to your child theme's functions.php file or into a custom plugin
function custom_posts_where_sql_for_only_expired() {
return ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end < "' . current_time( 'mysql', TRUE ) . '" ';
}