Currently, past events are showing along with upcoming events. we want to hide past events or separate from the upcoming list. Also, the entire list seems to be in a random order, it could be doing it from ID of the event rather than by date… any ideas how to sort by date?
Also if I wanted to customise the entire my events section to get away from the table and style it myself, which template would that be?
However, the above will change if you want to customize the view, so:
Also if I wanted to customise the entire my events section to get away from the table and style it myself, which template would that be?
All of the template files used for the my events section are from:
\eea-user-intergration\templates\
The exact template depends on what you want to edit, but by the sounds of it your completely changing the output, which will effect all templates, starting from:
Note that EE will check for any copies of the current templates in your themes root directory, so you can override the templates by copying them there.
When I went to edit the file it was already there yet members cannot see those changes applied (ie. they still see old events) I have cleared server cache and browser cache so works for me but can’t get 700 users to clear their own cache? any advice?
there was also another piece of code in there:
if ( $event->get_active_status() == 'DTI' ) { return; }
I have removed that and replaced so the start of the file now looks like this:
<?php
if ( $event->get_active_status() == 'DTE' ) { return; } // removes expired events
/**
* Template for the "event_section" content template for the [ESPRESSO_MY_EVENTS] shortcode
* Available template args:
*
* @type EE_Event $event event object
* @type string $your_tickets_title title for the ticket.
* @type int $att_id The id of the EE_Attendee related to the displayed data.
*/
$registrations = $event->get_many_related('Registration', array(array('ATT_ID' => $att_id)));
?>
What may be happening is you’re editing the wrong template. If the shortcode is [ESPRESSO_MY_EVENTS template=event_section]
then you’re editing the correct template.
If the shortcode is [ESPRESSO_MY_EVENTS template=simple_list_table]
then you’ll need to make the edits to the
content-espresso_my_events-simple_list_table.template.php template file. It’s also important that the custom template file is in the correct location. The correct location is in the top level of your active WordPress theme.
With regards to the order, the registrations are listed by the date of registration. So the most recent registrations will be listed last.
The event date order is a bit of a tricky thing to order by because events can have multiple start dates (because an event can have multiple datetimes).
If you only have one datetime for an event, the following code can re-order the items by event start date. It can be added to the loop-espresso_my_events-event_section.template.php template.
Fatal error: Uncaught Error: Call to a member function get() on boolean in /home/adamt364/public_html/membersfiles/wp-content/themes/blankslate/loop-espresso_my_events-event_section.template.php:47 Stack trace: #0 /home/adamt364/public_html/membersfiles/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_Template.helper.php(384): include() #1 /home/adamt364/public_html/membersfiles/wp-content/plugins/event-espresso-core-reg/core/helpers/EEH_Template.helper.php(296): EEH_Template::display_template('/home/adamt364/...', Array, true) #2 /home/adamt364/public_html/membersfiles/wp-content/plugins/eea-wp-user-integration/domain/entities/shortcodes/EspressoMyEvents.php(270): EEH_Template::locate_template('loop-espresso_m...', Array) #3 /home/adamt364/public_html/membersfiles/wp-content/plugins/eea-wp-user-integration/domain/entities/shortcodes/EspressoMyEvents.php(194): EventEspresso\WpUser\domain\entities\shortcodes\EspressoMyEvents->loadTemplate(Array) #4 /home/adamt364/public_html/membersfiles/wp-content/plugins/event in /home/adamt364/public_html/membersfiles/wp-content/themes/blankslate/loop-espresso_my_events-event_section.template.php on line 47
The support post ‘How to hide past events on the My Events shortcode’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.
Support forum for Event Espresso 3 and Event Espresso 4.