Support

Home Forums Event Espresso Premium Upcoming events shortcode

Upcoming events shortcode

Posted: January 13, 2019 at 9:48 am

Viewing 3 reply threads


AlainB

January 13, 2019 at 9:48 am

Hello,

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.

Thanks,


Tony

  • 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?


AlainB

January 14, 2019 at 11:31 am

Hi Tony,

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


Tony

  • Support Staff

January 14, 2019 at 2:56 pm

In that case, you can use this gist:

https://gist.github.com/Pebblo/d0d5f485ae0599e56e20

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

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

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.

Viewing 3 reply threads

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.

Event Espresso