Change text of events plugin

Home Forums Calendar Products Events Calendar PRO Change text of events plugin

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1192442
    Minori
    Participant

    Hello!

    I’d like to change the text of the events calendar plugin to change “events” to “training opportunities”. I want to apply this on the title – Upcoming events– and –Past events-. As well as on the next events/past events navigation.

    Best regards

    Nora

    #1192972
    Geoff B.
    Member

    Good evening Nora and welcome back!

    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,
    Geoff B.

     

    #1193761
    Minori
    Participant

    Hi! I’ve tried to change the code on functions.php but then the page just crashes, I don’t know if I didn’t understand the instructions, I’ve placed the code on top of the functions.php file like so:

    <?php
    
    $custom_text = array(
            'Venue' => 'Location',
            'Related %s' => 'Similar %s',
    
    /**
     * Autoloader
     *
     * Automatically load files when their classes are required.
     */
    spl_autoload_register( 'avada_register_classes' );
    function avada_register_classes( $class_name ) {
    	if ( class_exists( $class_name ) ) {
    		return;
    	}
    	if ( 'TGM_Plugin_Activation' == $class_name ) {
    		return;
    	}
    	$class_path = get_template_directory() . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'class-' . strtolower( str_replace( '_', '-', $class_name ) ) . '.php';
    	if ( file_exists( $class_path ) ) {
    		include $class_path;
    	}
    	if ( false !== strpos( $class_name, 'Avada_AvadaRedux' ) ) {
    		$class_path = get_template_directory() . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'avadaredux' . DIRECTORY_SEPARATOR . 'class-' . strtolower( str_replace( '_', '-', $class_name ) ) . '.php';
    		if ( file_exists( $class_path ) ) {
    			include $class_path;
    		}
    	}
    }

    and also like this

    <?php
    
    /**
     * Autoloader
     *
     * Automatically load files when their classes are required.
     */
    spl_autoload_register( 'avada_register_classes' );
    function avada_register_classes( $class_name ) {
    	if ( class_exists( $class_name ) ) {
    		return;
    	}
    	if ( 'TGM_Plugin_Activation' == $class_name ) {
    		return;
    	}
    	$class_path = get_template_directory() . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'class-' . strtolower( str_replace( '_', '-', $class_name ) ) . '.php';
    	if ( file_exists( $class_path ) ) {
    		include $class_path;
    	}
    	if ( false !== strpos( $class_name, 'Avada_AvadaRedux' ) ) {
    		$class_path = get_template_directory() . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'avadaredux' . DIRECTORY_SEPARATOR . 'class-' . strtolower( str_replace( '_', '-', $class_name ) ) . '.php';
    		if ( file_exists( $class_path ) ) {
    			include $class_path;
    		}
    	}
    }

    but either way the site crashes,help!

    Nora

    #1194285
    Geoff B.
    Member

    Hey Nora,

    Thank you for writing back.
    I am sorry this crashed you site.

    It certainly was not my intention. Yikes!

    Actually, there are 3 main things to be aware of for this code to work properly:

    1. Do not paste the opening <? ph p tag (since there is already one in your functions.php file).
    2. The code to use is actually found at the very bottom of that page (where it says “View Code snippet”. Everything else leading up to it is just for the explanation.
    3. You will need to tweak the code to your needs. In your case, that will most likely mean changing

    $custom_text = array(
    'Venue' => 'Location',
    'Related %s' => 'Similar %s',
    );

    to
    $custom_text = array(
    'events' => 'training opportunities',
    'Events' => 'Training opportunities',
    );

    Let me know if that helps.

    Have a great day!

    Geoff B.

    #1203947
    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 text of events plugin’ is closed to new replies.