Support

Home Forums Event Espresso Premium Upcoming events shortcode

Upcoming events shortcode

Posted: January 13, 2019 at 9:48 am


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.

You must be logged in to reply to this support post. Sign In or Register for an Account

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: publish

Updated by  Tony 5 days, 11 hours ago ago

Topic Tags

Notifications

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