Support

Home Forums Event Espresso Premium Upcoming Events Widget Message

Upcoming Events Widget Message

Posted: July 22, 2021 at 3:38 pm


AckermanInstitute

July 22, 2021 at 3:38 pm

We’re using the Upcoming Events Widget to display events from a selected category. If there are no upcoming events in that category, is there a way to add a message to say something like, “No upcoming events”?


Tony

  • Support Staff

July 28, 2021 at 8:50 am

Hi there,

It is possible but we don’t have anything within the default widget to do it.

Are you comfortable with PHP?

What you can is using something like this:

https://gist.github.com/joshfeck/27a285c4285a6c986053

Which is basically a copy of the default upcoming events widget but using that means you can change the code to output whatever you prefer.

Line 382 needs to be changed to something like:


} else {
    echo '<p>No upcoming events</p>';
}

Does that help?


AckermanInstitute

July 30, 2021 at 1:54 pm

Hi,

This worked exactly as needed. Thanks so much for your help, much appreciated!


Tony

  • Support Staff

August 2, 2021 at 3:16 am

You’re most welcome.

Any further issues/questions just let us know.

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

Event Espresso