Change no upcoming events message

Home Forums Calendar Products Events Calendar PRO Change no upcoming events message

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1364965
    hdsouth
    Participant

    Is 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

    #1365479
    Geoff B.
    Member

    Good 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.

    #1366728
    hdsouth
    Participant

    Thanks. 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

    #1367001
    Geoff B.
    Member

    Good 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.

    #1380677
    Support Droid
    Keymaster

    Hey 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

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Change no upcoming events message’ is closed to new replies.