replacing 'events' strings and labels

Home Forums Calendar Products Events Calendar PRO replacing 'events' strings and labels

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #966897
    Dorothy
    Participant

    Hi there

    Great plugin by the way!

    Just having a little problem – I’ve managed to change the title from ‘Upcoming Events’ to ‘Forthcoming Concerts’, but i’d really like to change all the labels where ‘events’ appear to concerts. I’ve tried adding in:

    add_filter( ‘gettext’, ‘events_to_concerts’ );
    function events_to_concerts( $text ) {
    return str_replace( ‘events’, ‘concerts’, $text );
    }

    But it seems to have no effect at all.

    My code so far looks like this –

    <?php
    //************Change title of upcoming concerts**********//
    add_filter(‘gettext’, ‘theme_filter_text’, 10, 3);

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

    // Copy and modify the following if {} statement to replace multiple blocks of text
    // Match the text you want you want to translate, preferably also match the text domain
    if($text === ‘Upcoming Events’ && $domain === ‘tribe-events-calendar’) {

    // The custom text you want instead
    $text = ‘Forthcoming Concerts’;

    } elseif($text === ‘Next Events’ && $domain === ‘tribe-events-calendar’) {

    $text = ‘Next Concert’; }

    elseif($text === ‘Previous Events’ && $domain === ‘tribe-events-calendar’) {

    $text = ‘Previous Concert’;}

    return $text;

    }
    add_filter( ‘gettext’, ‘events_to_concerts’ );
    function events_to_concerts( $text ) {
    return str_replace( ‘events’, ‘concerts’, $text );
    }
    ?>

    Any help would be really appriciated!

    Many thanks
    D

    #966929
    Brian
    Member

    Hi,

    Thanks for using our plugins.

    I can help out here.

    Have you tried out our tutorial on changing the word events?

    Here is the link:

    https://theeventscalendar.com/knowledgebase/changing-the-word-events-to-something-else/

    Let me know if that works for you.

    Thanks

    #967096
    Dorothy
    Participant

    You’re AMAZING!!!!! Thank you so much that worked perfectly!!!

    #967132
    Brian
    Member

    Great glad it helps.

    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 4 posts - 1 through 4 (of 4 total)
  • The topic ‘replacing 'events' strings and labels’ is closed to new replies.