Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the spinupwp domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /sites/coreysalzano.com/files/wp-includes/functions.php on line 6121
The Events Calendar List Widget Replacement – Corey Salzano

The Events Calendar List Widget Replacement

I wrote a plugin to customize the Events List widget that ships with Modern Tribe’s The Events Calendar Pro plugin. The widget has an option to hide completely when there are no upcoming events. The alternative displays the dreaded “There are no upcoming events at this time” in an otherwise empty Events List widget. I love the idea of not including the widget at all if there are no events, but what if this is the only widget in a sidebar or widget area? Sometimes, I want to display something in place of the widget instead of leaving the space empty. Here’s a plugin that does exactly that.

Download plugin

https://github.com/csalzano/the-events-calendar-list-widget-replacement

Where does the replacement content live?

Create a file at wp-content/themes/your-theme/tribe-events/pro/widgets/list-widget-replacement.php that contains the content you wish to display in place of the Events List widget when there are no upcoming events.

If you’re using the free version of The Events Calendar, create the file at wp-content/themes/your-theme/tribe-events/widgets/list-widget-replacement.php

(This file sits right next to list-widget.php, the template you might create to modify the output of the Events List widget. I chose these locations in the spirit of The Events Calendar Themer’s Guide.)

Here’s what my file looks like–I wrote some HTML that mimics a widget so I didn’t have to write any additional CSS styles for the replacement content. My client is a local municipality, so I put together some numbers that describe the size and age of a small Pennsylvania township.