Shortcode for upcoming events

Home Forums Calendar Products Events Calendar PRO Shortcode for upcoming events

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1059932
    Linda
    Participant

    Hi
    I have a shortcode on some of my pages to show the next 3 upcoming events for a particular venue but when there are no events to show it just leaves a blank space. How can I get it to show something like “no upcoming events” or something similar
    Thanks in advance

    #1060036
    Nico
    Member

    Hey Linda,

    Thanks for reaching out! Interesting question here, I must admit I’m not sure right off the top of my head about it, but surely willing to try that out myself and see if it’s possible at all.

    Can you please indicate what shortcode you are using to get these (tribe_events_list or tribe_featured_venue)? How/Where are you using it?

    Please let me know about it,
    Best,
    Nico

    #1061147
    Linda
    Participant

    Hi

    Shortcode i’m using is [tribe_featured_venue slug=”venuename” limit=”3″]

    Works fine when I have events for a particular venue but when there are none it just leaves a blank space.

    Appreciate your help!

    #1061148
    Linda
    Participant

    This reply is private.

    #1061864
    Nico
    Member

    Hi Linda,

    Thanks for following-up with the extra info! I’ve tested this on my end and you seem to be right about it. I’ve logged this as a new bug because as you said this wasn’t working like this before and you have no chance of showing a ‘no events for now’ message now!

    Digging into the code I’ve found the particular line which you can change to modify this behaviour. We usually don’t recommend patching core files (as plugin updates will clear the patches) but it seems this is the only way to make this issue right for now. So if you feel you really need this working, edit the file ‘events-calendar-pro/src/Tribe/Venue_Widget.php’ and in line 28 change:

    'hide_if_empty' => true,
    for
    'hide_if_empty' => false,

    This edit should do the trick for now, please let me know if it does for you,
    Best,
    Nico

    #1065468
    Linda
    Participant

    Hi
    Thanks for the quick response.
    To be honest I’d rather not mess around too much with the code and I can enter some events so it’s not a real necessity at the moment and hopefully this little bug can be sorted soon.
    Thanks anyway for all your help, much appreciated!

    #1065772
    Nico
    Member

    Hey Linda,

    Sounds good! The bug is logged and will be fixing at some point, so don’t worry if this is not critical…

    I’ll go ahead and close out this thread, but if you need help with anything else please don’t hesitate to create a new one and we will be happy to assist you.

    Best,
    Nico

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Shortcode for upcoming events’ is closed to new replies.