Customize Default Wording: Change 'Events' to 'Schedule'

Home Forums Calendar Products Events Calendar PRO Customize Default Wording: Change 'Events' to 'Schedule'

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1605264
    zericoni
    Participant

    I am using the Events Calendar as a schedule to inform patients what days certain doctors are available. I would like to change how some of the default text displays on the front end. For example, I want to change ‘Events for August 2018’ to ‘Schedule for August 2018’, wherever ‘Events’ is used. Can this be edited in a language file?

    #1607117
    Brendan
    Keymaster

    Hi there!

    Thank you for reaching out to us.

    I would love to help you with this topic.

    The simplest solution would be to use the following snippet: https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/

    Let me know how that goes.

    Best regards,
    Brendan

    #1607539
    zericoni
    Participant

    Hi Brendan,
    Thanks for input. I added the snippet to the top of my child theme’s functions.php file like this:

    $custom_text = array(
    ‘Events’ => ‘Calendar’,
    );

    However, it had no affect on the output shown in the attachment. What else should I try?

    Thank you.

    #1608275
    Brendan
    Keymaster

    Hi there,

    The instructions are a little confusing so I apologize. You will need to add the entire function to get this to work as seen below:

    function tribe_custom_theme_text ( $translation, $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(
    		'Events' => 'Schedule',
    	);
     
    	// 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);

    Let me know how that goes.

    Thanks,
    Brendan

    #1608294
    zericoni
    Participant

    Many thanks! Perfect solution!

    #1608690
    Brendan
    Keymaster

    Awesome, glad it worked!

    Thanks,
    Brendan

    #1626563
    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 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Customize Default Wording: Change 'Events' to 'Schedule'’ is closed to new replies.