Archive by year

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 9 years, 7 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #12586

    Is there a way to create an archive by year? A client would like to keep track of their past events in the sidebar, organized by year. Other than adding a category for each year I couldn’t see a way to do it.

    Colin Frangos
    #12587

    Hi Colin,

    There are already yearly archives (.e.g see http://wp-event-organiser.com/demo/events/event/on/2014/). Note that the demo runs an older version of Event Organiser, in later versions the ‘year’ page will show past events (when viewing past/current year).

    There will probably be a widget for year/month/day events link in a future update, though for the time being you can create a link to a day/month/year archive with eo_get_event_archive_link() (see codex). So you would need to determine how many years ‘to go back’ and then in a custom widget / shortcode use the following

    $years = array( 2012, 2013, 2014 );
    echo '<ul>';
    foreach( $years as $year ){
         printf( '<li> <a href="%s">%s</a> </li>', eo_get_event_archive_link( $year ), $year );
    }
    echo '</ul>';
    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.