Home › Forums › Calendar Products › Events Calendar PRO › Shortcode for upcoming events
- This topic has 6 replies, 2 voices, and was last updated 10 years, 2 months ago by
Nico.
-
AuthorPosts
-
January 21, 2016 at 6:18 am #1059932
Linda
ParticipantHi
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 advanceJanuary 21, 2016 at 11:20 am #1060036Nico
MemberHey 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,
NicoJanuary 24, 2016 at 3:09 am #1061147Linda
ParticipantHi
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!
January 24, 2016 at 3:11 am #1061148Linda
ParticipantThis reply is private.
January 25, 2016 at 8:31 am #1061864Nico
MemberHi 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,
NicoFebruary 1, 2016 at 3:35 am #1065468Linda
ParticipantHi
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!February 1, 2016 at 7:58 am #1065772Nico
MemberHey 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 -
AuthorPosts
- The topic ‘Shortcode for upcoming events’ is closed to new replies.
