Hi Stephen!
My “Past events” link disappeared from my client’s site for some reason, so I’m attempting to restore it. I created (again!) a page called “Past events” containing this shortcode:
[eo_events event_end_before="today" order="desc" showpastevents=true numberposts=10]
I’ve also customized “shortcode-event-list.php” (a copy placed in my theme folder) to change from a bulleted list to just a list, add the excerpt, etc. So far so good.
BUT…. if I limit it to, say, 10 events, I don’t get any navigation to view more (i.e. “Newer events / Older events”).
I feel like I may be approaching this the wrong way altogether… I don’t recall having to edit the shortcode template before…. but it’s been a long time. Can you advise? Thanks!
Thanks!
Adam Abrams
Hi Adam,
The shortcode is for single page lists.
This url should show past events (assuming you have selected to for past events to be visible): http://yoursite.com/events/event/?event_end_before=now
Stephen Harris
Thanks Stephen! It was indeed the “Show past events” setting that was causing this behaviour.
One thing – past events are showing oldest-first… how can I reverse it so it starts with the most recently finished event and goes backwards instead?
Adam Abrams
Never mind that last question, I figured out how to reverse the order, using “orderby=eventstart” at the end of the URL:
https://website.com/events/event?event_end_before=now&orderby=eventstart
However… in order for these events to show up, I checked “Show past events” in EO settings.
But that causes past events to show even on my Upcoming Events page, reached via this URL:
https://website.com/events/event?event_end_after=now
Despite the query only requesting future events.
So, two questions:
- How do I show future events only?
- How do I have a different page title for the Past Events page?
Both are using archive-event.php (customized version in my theme folder), and the code below for the page title…
Thanks!
<header class="page-header">
<h1 class="page-title">
<?php
if( eo_is_event_archive('day') )
//Viewing date archive
echo __('Events: ','eventorganiser').' '.eo_get_event_archive_date('jS F Y');
elseif( eo_is_event_archive('month') )
//Viewing month archive
echo __('Events: ','eventorganiser').' '.eo_get_event_archive_date('F Y');
elseif( eo_is_event_archive('year') )
//Viewing year archive
echo __('Events: ','eventorganiser').' '.eo_get_event_archive_date('Y');
else
_e('Coming Attractions','eventorganiser');
?>
</h1>
</header>
Adam Abrams