Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Created January 6, 2016 02:31
Show Gist options
  • Save lorenzocaum/807b5abbebaf5178fa2e to your computer and use it in GitHub Desktop.
Save lorenzocaum/807b5abbebaf5178fa2e to your computer and use it in GitHub Desktop.
How to change the page title for the events listing page from Events to something else in Event Espresso 4

Add the sample code below to your child theme's functions.php file or in a site specific plugin. Then change REPLACE ME to the new messaging that you would like to display to your attendees/registrants.

<?php
//* Do NOT include the opening php tag

//* Adjust the page title for the events listing page
function ee_custom_messaging_events_listing_page_title( $translated, $original, $domain ) {
    $strings = array(
        'Events' => 'REPLACE ME',
    );
    if ( isset( $strings[$original] ) ) {
        $translations = get_translations_for_domain( $domain );
        $translated = $translations->translate( $strings[$original] );
    }
    return $translated;
}
add_filter( 'gettext', 'ee_custom_messaging_events_listing_page_title', 10, 3 );
@lorenzocaum
Copy link
Author

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment