Posted: December 6, 2014 at 5:14 pm
|
I am using EE3 and creating a custom attendee listing template. The current version can be seen here: http://kennettdesign.staging.wpengine.com/attendee-listing/ I am trying to display the event starting date & time just below the event name and above the list of attendees. I have successfully added the date, but the time is always showing 7:00 pm even though that is not the correct time. The code I’m using in this section is:
Can you tell me what I’m missing or doing wrong? Thanks. |
|
Hi Greg, Oddly enough, the event start and end time are not held with the rest of the event data. I assume this is because it is needed in a variety of areas. Anyway, you can obtain that data by using echo event_espresso_get_time($event->id, ‘start_time’); this will output it in 08:00 am format by default. |
|
Great thank Dean that worked! Is it also possible to control the order in which the events are displayed? You’ll see on that page http://kennettdesign.staging.wpengine.com/attendee-listing/ [LISTATTENDEES order_by=date(start_date),id show_expired=”false” show_deleted=”false” show_recurrence=”false” paid_only=”true”] |
|
Also… to show the event location, I am trying to use the following:
Followed by an echo statement but so far no luck. Is there something I’m missing? |
|
Sorry… for so many questions, but just one more! While showing the list of attendees is normally also the number of guests, sometimes we have a situation like this one where 1 person paid for a group of 12. https://dl.dropboxusercontent.com/u/4138085/ee-attendee-qty.jpg Is it possible to show the “quantity” number in addition to the attendee name? Thanks! |
|
Hi, 1) The shortcode doesn’t have any active sorting feature. There is one that is in the code but is not active, but it only sorts the attendees not the events. Currently there is no sorting order for the events, they will be shown in ID order by default. The only way to force a sort order would be to amend the shortcode found in /wp-content/plugins/event-espresso/includes/shortcodes.php The function is pluggable so can be copied to a site specific plugin and modified there rather than editing the core files. EDIT: in the attendee_list.php you could sort the events array. 2) This depends on how you have set up the location. If it is via the location fields in the event, then you can use $event->venue_title (venue_title, venue_url, venue_image, venue_phone). If it is via the venue manager then it will be quite different. That data isn’t provided in this template so you would need to do a database call to grab it. 3) $attendee->quantity will output the number of tickets purchased. That would need to be echoed in the foreach that is outputting the attendees in the attendee_list.php file (approx line 99) Hopefully some of that makes sense, but let me know if you have any questions. |
|
Thanks Dean! 1. I’m trying to digest this fully. I understand the idea of sorting the array in the template just not that experienced with it so may come back with follow-up question(s) on that. 2. We are using the Venue Manager. We would like to show just the name of the venue for the event. Does that make it any easier? 3. This worked great – thanks! |
|
Hi, 1) Yeah sorry, I couldn’t simplify it further. The shortcode basically doesn’t have sorting functions so they would need to be done either by modifying the shortcode code or as mentioned, sorting the event array. 2) Not really, the problem is that the venue data is not already requested at this point as the attendee list was designed to only show a list of attendees. As such the only way I can currently see to get the venue data would be to query the database and get the table events_venue_rel and events_venue in arrays and then match up the venue to the event. 3) No problem! |
The support post ‘How to Add Event Start Time to Attendee Listing?’ 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.