Support

Home Forums Event Espresso Premium Coding Tips for Displaying –> Upcoming Event Summary

Coding Tips for Displaying –> Upcoming Event Summary

Posted: May 26, 2019 at 6:41 pm

Viewing 7 reply threads


dirk.tussing

May 26, 2019 at 6:41 pm

Hey Event Expresso – We are using Astra Theme & customizing the theme with Elementor. On our homepage, we would like to summarize 4-6 upcoming events using a simple UIX displaying their dates. Here is a screen shot of what we could use any tips you can loop back with:

Upcoming Events


Tony

  • Support Staff

May 28, 2019 at 5:10 am

Hi there,

I’d recommend you take a look at the EE upcoming events widget in \event-espresso-core-reg\widgets\upcoming_events\EEW_Upcoming_Events.widget.php

That will give you an idea on how to create the above, although the HTML structure will be different, so that’s down to you (we don’t provide support for customizations, although we can help point you in the right direction to get the details you need from EE).


dirk.tussing

May 28, 2019 at 5:54 am

Thanks Tony – Just wanted to make sure we are focused in the right area and can take it from here.

My 2nd question: I was trying to add/remove a few of the “Event Types” categories, but could not find the screen to edit them. I can find “Event Categories” edit screen but not the Event Types…

my event types are in-person & virtual. Here is a screen shoot from my config:
https://s3.amazonaws.com/execlearn/Website/WIP/EventExpress-EventTypes.PNG

appreciate additional insights, Dirk


Tony

  • Support Staff

May 28, 2019 at 8:48 am

You won’t find a UI for removing those as EE doesn’t display them by default.

May I ask how you enabled Event Types?


dirk.tussing

May 28, 2019 at 10:11 am

Hi Tony,

Thanks for the feedback. Would be helpful to know how to get EE date and month separately.

 if ($show_dates) {
                                    $date_format = apply_filters('FHEE__espresso_event_date_range__date_format', get_option('date_format'));
                                    $time_format = apply_filters('FHEE__espresso_event_date_range__time_format', get_option('time_format'));
                                    $single_date_format = apply_filters('FHEE__espresso_event_date_range__single_date_format', get_option('date_format'));
                                    $single_time_format = apply_filters('FHEE__espresso_event_date_range__single_time_format', get_option('time_format'));
                                    if ($date_range == true) {
                                        echo espresso_event_date_range($date_format, $time_format, $single_date_format, $single_time_format, $event->ID());
                                    } else {
                                        echo espresso_list_of_event_dates($event->ID(), $date_format, $time_format, false, null, true, true, $date_limit);
                                    }
                                }

Thanks.


Tony

  • Support Staff

May 28, 2019 at 1:29 pm

You’re looking for the details from a ‘DateTime’ within an event and an event can have multiple datetimes ordered in different ways, so the answer to your question depends on your event set up.

However, if you take a look at the EEH_Event_View helper class in

\event-espresso-core-reg\core\helpers\EEH_Event_View.helper.php

It has various methods you can use to pull details for the event in question.

What I would use based on the screenshot and a simple example of a single DateTime is:

$datetime = EEH_Event_View::get_earliest_date_obj($EVT_ID);

$datetime will then be an instance of EE_Datetime which has multiple methods available to it for outputting dates, such as:

echo datetime->get_i18n_datetime('DTT_EVT_start', 'M');

Would output the month.

As an example (and this method outputs something similar to what you are trying to do) take a look at the event_date_as_calendar_page() method in the same file above, it shows you how you can output the month and day for a DateTime.


dirk.tussing

May 28, 2019 at 2:56 pm

Thanks Tony – Our WP programmer was able to use your suggestions and quickly tweaked the HTML code using Elementor to make an awesome table. He doesnt remember how he “turned on” Event Types. After he finishes with the Upcoming Event Widget customization to add date/time, he plans to figure out what he did. Thank you again!!!


Tony

  • Support Staff

May 29, 2019 at 7:20 am

You’re most welcome, I’m glad the above helped.

Viewing 7 reply threads

The support post ‘Coding Tips for Displaying –> Upcoming Event Summary’ 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.

Event Espresso