Changing tribe-events-notices

Home Forums Additional Help Translations Changing tribe-events-notices

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1110242
    Jeramiah Young
    Guest

    I have tried changing the notice “There were no results found.” using the code from the related thread below and putting that into my theme’s functions.php file:


    add_filter( 'tribe_events_the_notices', 'customize_notice', 10, 2 );
    function customize_notice( $html, $notices ) {
    //If text is found in notice, then replace it
    if( stristr( $html, 'There were no results found.' ) ) {
    //Customize the message as needed
    $html = str_replace( 'There were no results found.', 'We are continually working to add additional dates and/or locations for upcoming markets. Be sure to check back for additional event dates & details!', $html );
    }

    return $html;
    }

    Unfortunately this code does not work. Any ideas how I can change the language of that?

    RELATED THREAD: https://theeventscalendar.com/support/forums/topic/change-the-text-for-tribe_events_the_notices-on-events-that-have-passed/

    #1110262
    Jeramiah Young
    Guest

    I also found this thread https://theeventscalendar.com/support/forums/topic/there-were-no-results-found-to-there-were-no-results-found-see-next-month/
    as reported by the client, this code does not work either.


    /*
    * Change No results Found Message
    * @version 3.9
    *
    */
    add_filter('gettext', 'tec_filter_translations', 10, 3);
    function tec_filter_translations($translations, $text, $domain) {
    if ($domain == 'tribe-events-calendar') {

    $text = str_ireplace( 'There were no results found.', 'There were no results found-see next month', $text );

    }
    return $text;
    }

    #1110269
    Jeramiah Young
    Guest

    It might be useful to note that I’m using the Pro version – so maybe it’s different?

    #1110302
    Jeramiah Young
    Guest

    Ok this code, you supplied in another article worked.


    function tribe_custom_theme_text ( $translations, $text, $domain ) {

    // Put your custom text here in a key => value pair
    // Example: 'Text you want to change' => 'This is what it will be changed to'
    // The text you want to change is the key, and it is case-sensitive
    // The text you want to change it to is the value
    // You can freely add or remove key => values, but make sure to separate them with a comma
    // This example changes the label "Venue" to "Location", and "Related Events" to "Similar Events"
    $custom_text = array(
    'There were no results found.' => 'We are continually working to add additional dates and/or locations. Be sure to check back for additional event dates & details!',

    );

    // If this text domain starts with "tribe-" or "the-events-", and we have replacement text
    if((strpos($domain, 'tribe-') === 0 || strpos($domain, 'the-events-') === 0) && array_key_exists($text, $custom_text) ) {
    $text = $custom_text[$text];
    }

    return $text;
    }
    add_filter('gettext', 'tribe_custom_theme_text', 20, 3);

    #1110370
    Brian
    Keymaster

    Hi,

    Thanks for using the Events Calendar.

    Glad you found a solution.

    In the future here on the pre-sales forum, I’m afraid we do not provide technical support.

    Please post in the premium forums to get support for Pro and other premium plugins.

    Since this is marked resolved I am going to close this ticket, but if you need anything else related to this topic or another please post a new topic on the forum and we can help you out.

    Thanks

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Changing tribe-events-notices’ is closed to new replies.