Home › Forums › Calendar Products › Events Calendar PRO › change heading text in event-bar
- This topic has 3 replies, 2 voices, and was last updated 10 years, 5 months ago by
Brook.
-
AuthorPosts
-
November 12, 2015 at 9:19 am #1024815
Matthew
ParticipantHi,
I’m trying to change the placeholder label in the search bar from “Location” to “Enter City or Zip” because it returns no events if you enter the state.
I found this thread:
I altered it and entered this:
function event_bar_modify_placeholder_text( array $filters ) {
foreach ( $filters as &$single_filter ) {
$single_filter[‘html’] = str_replace(
‘placeholder=”Location”‘,
‘placeholder=”Enter City or Zip”‘,
$single_filter[‘html’] );
}return $filters;
}add_filter( ‘tribe-events-bar-filters’, ‘event_bar_modify_placeholder_text,
I added the snippet to my site plugin (where I add any custom functions) and I got this error:
Parse error: syntax error, unexpected ”event_bar_modify_placeholder_’ (T_ENCAPSED_AND_WHITESPACE) in /home/content/p3pnexwpnas10_data01/74/2764374/html/wp-content/plugins/physiocourse-plugin/physiocourse-plugin.php on line 433
It seems to suggest the snippet is not finished. I tried to finish it with ); but that did not help. I also tried just the original snippet that was to change the date placeholder but the same thing happened.
My apologies, I’m not code literate but I don’t want to pay a developer for a simple change in the text if I can avoid it 🙂
Thanks in advance
MatNovember 12, 2015 at 1:51 pm #1024933Brook
ParticipantHowdy Matthew,
Good question. That is a bit of an old snippet for adjust the text. We have an update method that is a bit simpler. You should be able to just copy/paste the following code to change that text:
[php]
/*
* EXAMPLE OF CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
* See the codex to learn more about WP text domains:
* http://codex.wordpress.org/Translating_WordPress#Localization_Technology
* Example Tribe domains: ‘tribe-events-calendar’, ‘tribe-events-calendar-pro’…
*/
function tribe_custom_theme_text ( $translations, $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(
‘Location’ => ‘Enter City or Zip’,
);// If this text domain starts with "tribe-", and we have replacement text
if(strpos($domain, ‘tribe-‘) === 0 && array_key_exists($text, $custom_text) ) {
$text = $custom_text[$text];
}return $text;
}
add_filter(‘gettext’, ‘tribe_custom_theme_text’, 20, 3);[/php]Does that all make sense? Will that work for you? Please let me know.
Cheers!
– Brook
November 13, 2015 at 5:46 am #1025102Matthew
ParticipantThat worked nicely,
thanks Brook
November 13, 2015 at 2:43 pm #1025491Brook
ParticipantExcellent! Thanks for letting me know.
Cheers!
– Brook
-
AuthorPosts
- The topic ‘change heading text in event-bar’ is closed to new replies.
