Home › Forums › Calendar Products › Events Calendar PRO › replacing 'events' strings and labels
- This topic has 3 replies, 2 voices, and was last updated 11 years ago by
Brian.
-
AuthorPosts
-
June 3, 2015 at 6:53 am #966897
Dorothy
ParticipantHi 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
DJune 3, 2015 at 7:58 am #966929Brian
MemberHi,
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
June 4, 2015 at 3:03 am #967096Dorothy
ParticipantYou’re AMAZING!!!!! Thank you so much that worked perfectly!!!
June 4, 2015 at 6:09 am #967132Brian
MemberGreat 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
-
AuthorPosts
- The topic ‘replacing 'events' strings and labels’ is closed to new replies.
