Skip to content

Instantly share code, notes, and snippets.

/functions.php Secret

Created September 23, 2015 01:48
Show Gist options
  • Save anonymous/9bebfcf2a4f839794701 to your computer and use it in GitHub Desktop.
Save anonymous/9bebfcf2a4f839794701 to your computer and use it in GitHub Desktop.
my functions.php
<?php
// if you want to add some custom function
/*
* CHANGING ANY TEXT (STRING) IN THE EVENTS CALENDAR
*/
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(
'Venue' => 'Location',
'Venues' => 'Locations',
'Organizers' => 'Instructors',
'Organizer' => 'Instructor'
);
// If this text domain starts with “tribe-“, and we have replacement text
if(strpos($domain, 'the-') === 0 && array_key_exists($text, $custom_text) ) {
$text = $custom_text[$text];
}
return $text;
}
add_filter('gettext', 'tribe_custom_theme_text', 20, 3);
// Change VENUE to LOCATION
function filter_translations($translation, $text, $domain) {
if ($domain == 'the-events-calendar') {
switch ($text) {
case 'Organizer':
$translation = 'Instructor';
break;
}
}
return $translation;
}
add_filter('gettext', 'filter_translations', 10, 3);
add_filter('tribe_venue_label_singular', 'change_single_venue_label' );
function change_single_venue_label() {
return 'Location';
}
add_filter('tribe_venue_label_plural', 'change_plural_venue_label' );
function change_plural_venue_label() {
return 'Locations';
}
add_filter('tribe_organizer_label_singular', 'change_single_organizer_label' );
function change_single_organizer_label() {
return 'Instructor';
}
add_filter('tribe_organizer_label_plural', 'change_plural_organizer_label' );
function change_plural_organizer_label() {
return 'Instructors';
}
function all_scriptsandstyles() {
//Load JS and CSS files in here
//wp_register_script ('placeholder', get_stylesheet_directory_uri() . '/js/placeholder.js', array( 'jquery' ),'1',true);
wp_register_style ('googlefonts', 'http://fonts.googleapis.com/css?family=Raleway:400,500,600,700,800,900', array(),'2','all');
//wp_enqueue_script('placeholder');
wp_enqueue_style( 'googlefonts');
//wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array( 'zorka_style-min' ) );
}
add_action( 'wp_enqueue_scripts', 'all_scriptsandstyles' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment