pronamic / wp-pronamic-events

Pronamic Events is a basic plugin to add some Events functionality.
http://www.pronamic.eu/plugins/pronamic-events/
5 stars 3 forks source link

Events archive #12

Closed kjtolsma closed 10 years ago

kjtolsma commented 11 years ago

Is it possible to make an option for showing all events? Events in the past included. Maybe we can add an extra class to those specific articles.

remcotolsma commented 10 years ago

We did some improvements regarding this issue:

WordPress Query

$query = new WP_Query( array(
    'post_type'                 => 'pronamic_event',
    'pronamic_event_date_after' => strtotime( 'today' ), // default
    'orderby'                   => 'pronamic_event_start_date', // default
) );
$query = new WP_Query( array(
    'post_type'                 => 'pronamic_event',
    'pronamic_event_date_after' => strtotime( '-1 month' ),
    'orderby'                   => 'date',
) );
$query = new WP_Query( array(
    'post_type'                 => 'pronamic_event',
    'pronamic_event_date_after' => false,
    'orderby'                   => 'pronamic_event_start_date',
) );

Parameters

pronamic_event_date_after

Type: int
Default: strtotime( 'today' )

orderby

Type: string
Default: pronamic_event_start_date

Post Class

The Pronamic Events will automatic add the event-ended post class if an event is ended.