In case the users want to access all the past events, a completely new page needs to be created from the admin panel. The past event page enables a user to visualize and get details of the events that had taken place (occurred) in the past.
To add shortcodes for Past Events
- Log into Admin panel.
- Add a new page under the pages menu on the Dashboard.
- Mention the Page Title(Past Event).
- Mention the shortcode on the content section of the dashboard.
- Preview and publish it on the website.
The other way to add the code it through a functions.php file
- Login to the Admin Panel.
- Under the child theme, functions.php file, mentioned the shortcode mentioned below:
do_shortcode( '[past_events]' );
- Save it and you are good to go.
The Past Event Listings Shortcode Attributes
The following are the different attributes that are associated with the past event listings
- per_page: Defaults to the ‘per page’ option in settings. This controls how many events get listed per page.
- orderby: Supports title, ID, name, modified, parent, rand,event_start_date.
- order: Defaults to ‘ASC’. Can be set to ‘ASC’ or ‘DESC’ to choose the sorting direction.
- show_pagination: Defaults to false. Enable this to show numbered pagination instead of the ‘load more events’ link
- location: Enter a location keyword to search by default.
- keywords: Enter a keyword to search by default.
- selected_datetime: Select the range of date & time to showcase particular event happening in that time frame.
- selected_event_type: Comma separate slugs to select by default.
- selected_categories: Use Comma to separate slugs(categories) to select by default.