Home Forums Event Espresso Premium Upcoming events shortcode

Upcoming events shortcode

Posted: January 13, 2019 at 9:48 am


January 13, 2019 at 9:48 am


On my website I’m using the upcoming events widget. However, I currently dont have any events coming up. Could I make the shortcode to show this? Since its just blank now.



  • Support Staff

January 14, 2019 at 7:17 am

Hi there,

The widget and shortcode are 2 different things, so is it the widget you want to change to show something when you have no upcoming events?

If so you can, but you’ll need to add some code to your site to do it, are you comfortable with PHP?


January 14, 2019 at 11:31 am

Hi Tony,

Yeah sorry, it’s the widget. And sure, im comfortable with PHP!


  • Support Staff

January 14, 2019 at 2:56 pm

In that case, you can use this gist:

Add that to a custom functions plugin on your site, we have some documentation on creating one here:

Then between lines 385 and 386 add whatever you want the widget to output when no events are available.

Note that widget adds a ‘Custom Event Espresso Upcoming Events’ widget to Appearance -> Widgets and you need to use that in place of the default, its to allow you to edit the widget from within a plugin, editing the core plugins widget you’ll lose the modifications when EE updates, with the plugin you wont.

The support post ‘Upcoming events shortcode’ 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.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 5 months ago ago

Topic Tags


This topic is: not resolved
Do NOT follow this link or you will be banned from the site!