I have the latest everything. WordPress and Event Espresso.
I am hoping this is solvable…
I am using Upcoming Event widget but the widget still appears even if there is no events listed. How I do have the widget not show up if there is no events.
If you make a copy of plugins/event-espresso/templates/widget.php and place it in uploads/espresso/templates, then you can modify it and keep the modifications after you update. Remove the following lines starting at line 28:
/* Before widget (defined by themes). */
echo $before_widget;
/* Display the widget title if one was input (before and after defined by themes). */
if ($title)
echo $before_title . $title . $after_title;
then place the following at what will then be line 64, after
$events = $wpdb->get_results($sql);
if (count($events) == 0)
return;
/* Before widget (defined by themes). */
echo $before_widget;
/* Display the widget title if one was input (before and after defined by themes). */
if ($title)
echo $before_title . $title . $after_title;
EE Rocks and the people that make it work rock even more!!!
Viewing 2 reply threads
The support post ‘Remove Widget if NO events listed?’ 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.