I have a custom events widget set up and would like to only show the event for the current week (next 7 days) and not show other datetimes for the event.
Either it didn’t work or I wasn’t clear enough (my apologies). It is still displaying all the datetimes for the events and I only want the datetime for this week to display. We have courses that run for several weeks and so we’ve created multiple datetimes for each class in a course.
I added the snippet to my functions plugin.
I downloaded the custom widget from a link in a previous forum post on customizing the widget, but I can’t find the link now. It looks like a copy of the original widget.
Here’s the opening few lines of my custom widget:
class EEW_Custom_Upcoming_Events extends WP_Widget {
/**
* Register widget with WordPress.
*/
function __construct() {
parent::__construct(
'ee-upcoming-events-widget',
__( 'Homepage Upcoming Events', 'event_espresso' ),
array( 'description' => __( 'A widget to display your upcoming events on the homepage.', 'event_espresso' )),
array(
'width' => 300,
'height' => 350,
'id_base' => 'ee-upcoming-events-widget'
)
);
}
I’m sorry, I forget to mention that you can control the number of datetimes displayed by going to the widget settings. There you can set the number of datetimes to 1.
Great. That worked. I had an error in a custom espresso_list_of_event_dates function that was causing more than one date to show, but all fixed now. Thanks for all your help.
Viewing 4 reply threads
The support post ‘Custom Event Widget Only show current week's events’ 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.