Pagination with past events list?

This topic contains 3 replies, has 2 voices, and was last updated by  Adam Abrams 1 year, 1 month ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #42335

    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
    #42367

    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
    #42370

    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
    #42378

    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:

    1. How do I show future events only?
    2. 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
Viewing 4 posts - 1 through 4 (of 4 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.