Home › Forums › Calendar Products › Events Calendar PRO › Change no upcoming events message
- This topic has 5 replies, 2 voices, and was last updated 8 years, 5 months ago by
hdsouth.
-
AuthorPosts
-
October 17, 2017 at 3:41 pm #1364965
hdsouth
ParticipantIs there an easy way to change the “No upcoming events” message when using a shortcode and no events are available for that category? Or does it have to be hardcoded?
Thanks
October 18, 2017 at 9:46 am #1365479Geoff B.
MemberGood afternoon Ginnie and welcome back!
Thank you for reaching out to us.
I would love to help you with this topic.To display a custom message when no events are available for a specific category in the context of the shortcode exclusively is possible.
However it will require customization on your end.
You can read about that here: https://theeventscalendar.com/customizations/
If coding is not really your cup of tea, you could always hire one of our recommended customizers to do the customization for you.
With that in mind, it is fairly easy to change that for everything (meaning not specifically for these contexts). Read the following article to accomplish that: https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/
The string to change is “There are no upcoming %s at this time.”
Another solution would be to use a snippet to fast forward to the next upcoming event if any while using a shortcode. I would need an example of usage to point you in the correct direction.
Let me know if that helps.
Have a great day!
Geoff B.
October 20, 2017 at 11:26 am #1366728hdsouth
ParticipantThanks. I wanted to changed for the whole site so I use this code in the functions.php
function tribe_custom_theme_text ( $translation, $text, $domain ) {
$custom_text = array(
‘There are no upcoming %s at this time.’ => ‘New %s coming soon’
);// If this text domain starts with “tribe-“, “the-events-“, or “event-” and we have replacement text
if( (strpos($domain, ‘tribe-‘) === 0 || strpos($domain, ‘the-events-‘) === 0 || strpos($domain, ‘event-‘) === 0) && array_key_exists($translation, $custom_text) ) {
$translation = $custom_text[$translation];
}return $translation;
}
add_filter(‘gettext’, ‘tribe_custom_theme_text’, 20, 3);Am I doing something wrong? I was not sure what text domain was??
Thanks
October 20, 2017 at 11:36 pm #1367001Geoff B.
MemberGood evening Ginnie,
Without looking at your files and config, it is a bit hard to say what is going on.
As a first troubleshooting step, could you please provide us with your complete system information in a private reply using the instructions found in the following link?
https://theeventscalendar.com/knowledgebase/sharing-sys-info/
Could you also please send me a copy of the latest version of your WordPress theme / child theme via a link to a .zip file link (stored Dropbox or Google Drive) so that I can run some tests on my end ? I recommend a private reply for that purpose.
Please ensure you are using the latest files as found on your actual website.
This way I will get access to any updates or customizations you might have made.Have a good weekend,
Geoff B.
November 11, 2017 at 8:35 am #1380677Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘Change no upcoming events message’ is closed to new replies.
