Home › Forums › Calendar Products › Events Calendar PRO › Changing the word "Events" on the front end only?
- This topic has 12 replies, 2 voices, and was last updated 11 years ago by
George.
-
AuthorPosts
-
April 7, 2015 at 1:37 am #953645
James
ParticipantHi,
I’ve been trying to find how I can change the word Event on the front end (what the visitor sees).
On the month page it has “Events for April 2015” I would like to change it to Activities for April 2015 (or what ever month they are viewing.
Also there is the word event use in the search section, the export month’s events box.
Then when you click on a event there is a “All EVENTS” link which I would like to change to ALL ACTIVITIES
On the list view, there is Upcoming Events, « Previous Events. All I would like to change to Activities instead of events.
Thanks for any assistance.
Cheers
JamesApril 7, 2015 at 1:49 am #953646James
ParticipantI found this after posting my question https://theeventscalendar.com/support/forums/topic/changing-event-to-something-else/ and I modified the code from meeting to Activity but it didn’t seem to change anything. I cleared all caches but still didn’t change.
April 9, 2015 at 9:52 am #954372George
ParticipantHey James!
Sorry for the delay in response here, we normally try to get to replies in less than 24 hours and I made a dumb mistake with my queue management that led to me missing a few tickets – like yours! Sorry about that James.
Now, as for your issues, do you mean that you tried the exact code from this Knowledgebase Article → https://theeventscalendar.com/knowledgebase/changing-the-word-events-to-something-else/?
If so, how did you add this code on your site? If you added it to your theme’s functions.php, can you copy and paste the entire, un-edited file into a Gist at http://github.com and share a link to that Gist here?
Thanks James!
April 9, 2015 at 3:24 pm #954480James
ParticipantHi George,
Thanks for getting back to me.
I’m using Dynamik Website Builder Child Theme which has a custom function section, where you place custom function code. I added the code into that section. Below is a copy of all the code in this custom function section as I don’t know how to use Gist. (there is no spaces at beginning or end of code)
Thanks
James
<?php
/* Do not remove this line. Add your functions below. *//**
* Enables the HTTP Strict Transport Security (HSTS) header.
*
* @since 1.0.0
*/
function tgm_io_strict_transport_security() {header( ‘Strict-Transport-Security: max-age=10886400; includeSubDomains; preload’ );
}
/*
* 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’ => ‘Meetup Location’,
‘Tickets’ => ‘Book here to attend this activity’,
‘Related Events’ => ‘Other Activities’,
‘Other’ => ‘Other Details’,
‘Organizer’ => ‘Mentor/Guide’,
‘Details’ => ‘When/Cost’,
);// 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);/* Genesis WooCommerce Plugin */
add_theme_support( ‘genesis-connect-woocommerce’ );//* Remove Additional Information Tab from WooCommerce
add_filter( ‘woocommerce_product_tabs’, ‘woo_remove_product_tabs’, 98 );
function woo_remove_product_tabs( $tabs ) {
unset( $tabs[‘additional_information’] ); // Remove the additional information tab
return $tabs;
}//* Customize the post info function
add_filter( ‘genesis_post_info’, ‘sp_post_info_filter’ ); function sp_post_info_filter($post_info) { if ( !is_page() ) {
$post_info = ‘[post_date] by [post_author_link] [post_comments] [post_edit]’;
return $post_info;
}}//* Customize the footer credits
add_filter( ‘genesis_footer_creds_text’, ‘sp_footer_creds_text’ ); function sp_footer_creds_text() {
echo ‘<div class=”creds”><p>’;
echo ‘Copyright © ‘;
echo date(‘2015’);
echo ‘ · James Doyle Photography | All Rights Reserved | ABN: 35 872 159 410 ‘;
echo ‘</p></div>’;
}define (‘YOAST_VIDEO_SITEMAP_BASENAME’, ‘vsvideo’);
//* Forcing Categories to display in List View in The Events Calendar add_action(‘parse_query’, ‘use_list_view_for_categories’, 60);
function use_list_view_for_categories($query) {
// Run once
remove_action(‘parse_query’, ‘use_list_view_for_categories’, 60);// Interfere only for non-ajax Tribe category requests not already destined to be presented by list view
if (defined(‘DOING_AJAX’) && DOING_AJAX) return;
if (!isset($query->tribe_is_event_category) || !$query->tribe_is_event_category) return;
if (tribe_is_view(‘upcoming’)) return;// Obtain the query term and get a link to list view for that term
$main_tax_query = $query->tax_query->queries[0];
$term = get_term_by(‘slug’, $main_tax_query[‘terms’][0], TribeEvents::TAXONOMY);
$link = tribe_get_listview_link($term->term_id);// Try to redirect
wp_redirect($link);
exit();
}add_action(‘wp_410_response’,’load_410_template’,1,0);
function load_410_template() {
require(‘410.php’);
exit(0);
}//* Modify the speak your mind title in comments
add_filter( ‘comment_form_defaults’, ‘sp_comment_form_defaults’ ); function sp_comment_form_defaults( $defaults ) {
$defaults[‘title_reply’] = __( ‘Leave a Comment’ );
return $defaults;}
//* Redirect Venues in Event Manager
add_action( ‘init’, ‘fix_tribe_venue_org_slugs’, 11 );
function fix_tribe_venue_org_slugs() {
if ( ! class_exists( ‘TribeEvents’ ) ) return;
$tribe = TribeEvents::instance();
$tribe->postVenueTypeArgs[‘rewrite’][‘slug’] = ‘venue’; }//* Change Event Name to Activities in Event Manager
add_filter(‘gettext’, ‘theme_filter_text’, 10, 3);
function theme_filter_text( $translations, $text, $domain ) { // If this text domain starts with “tribe-”
if(strpos($domain, ‘tribe-‘) === 0) {
// Replace upper case, lower case, singular, and plural $text = str_replace( // Text to search for array(‘Event’, ‘event’, ‘Events’, ‘events’),// Text to replace it with — change this for your needs array(‘Activity’, ‘activity’, ‘Activities’, ‘activities’), $text );
}
return $text;
}add_filter(‘ngettext’, ‘theme_filter_ntext’, 10, 5);
function theme_filter_ntext( $translation, $single, $plural, $number, $domain ) { // If this text domain starts with “tribe-”
if(strpos($domain, ‘tribe-‘) === 0) {
// Replace upper case, lower case, singular, and plural if( $number > 1 ) { $plural = str_replace( // Text to search for array(‘Events’, ‘events’),// Text to replace it with — change this for your needs array(‘Activities’, ‘activities’), $plural );
return $plural;
} else {
$single = str_replace(
// Text to search for
array(‘Event’, ‘event’),// Text to replace it with — change this for your needs array(‘Activity’, ‘activity’), $single );
return $single;
}
}
}April 11, 2015 at 6:52 am #954792George
ParticipantHi James,
Is this “custom function” section in a file called functions.php in your child theme? If not, please add the code directly to functions.php
Also, I noticed in the comments in your custom code, that you’re referring to something called “Event Manager” – this is not The Events Calendar, which is our plugin, so if you’ve got something called Event Manager active on your site, and are using our recommended code for our plugin, it will not work.
April 11, 2015 at 3:00 pm #954829James
ParticipantHi George,
Ok I’ve been doing a bit of testing with possible solutions. (but I am no coder or developer)
I’m running Genesis with the Dynamik Website Builder Child Theme.
If I put the event calendar code in the actual functions.php file of the child theme, I get a “white screen of death”. If I put the code in the custom function file, nothing changes. This custom function section code is stored in a custom-functions.php file within the child theme folder.
So I installed the wordpress twenty fourteen theme and put the event calendar code in the twenty fourteen theme’s functions.php file, it sort of worked, it did make changes to the names but the plural names were incorrect. Instead of “Activities” it showed “activitys”.
The wording “Event Manager” you mention, was a typo error on my part but being a comment I didn’t think it would make any difference. I have now change the event calendar code to exactly as it is on your website, only changing the wording of event, events, as per instructions.
I’m now thinking there isn’t any easy solution for me whilst using the Dynamik Website Builder Child Theme, so I have resigned myself to having the words “event” on my site.
Regards
James
April 12, 2015 at 12:51 pm #954904George
ParticipantHey James,
Before you resign yourself to using the default “Events” titles and such, could you copy and paste the entire, un-edited version of your theme’s actual functions.php file into a Gist at http://gist.github.com? Then, share a link to that Gist.
You mentioned earlier that you don’t know how to use Gist, but it’s quite simple – just copy the entire, un-edited contents of the functions.php file, and paste it into the main textarea of the Gist at http://gist.github.com, then click “Create public Gist” and share a link to the URL of the Gist you create by clicking that.
I’ll try to manually add the code recommended here, as it should work, and indeed does work for many people, so it could just a be a simply typo or something that we can correct and have this working for you.
Let us know if you can get the Gist created James – I appreciate your patience so far, and one thing worth pointing out is that the next release of the plugin makes this change extremely easy! It’s one of the coolest things about the new release, in my opinion, and if we can’t get this code to work for now, then rest assured that we’ll at least have the new solution released to the public in no more than a few weeks from now.
Cheers,
GeorgeApril 12, 2015 at 2:58 pm #954929James
ParticipantHello George,
Thanks for offering to continue with this.
A copy of the functions.php code can be found at https://gist.github.com/anonymous/c761b51310b1f49d5fa4
Thanks George,
James
April 12, 2015 at 3:34 pm #954930James
ParticipantApril 12, 2015 at 3:35 pm #954931James
ParticipantSorry I goofed with the link, here it is
April 13, 2015 at 9:06 am #955083George
ParticipantHi James,
Thanks for posting that code.
I’d recommend getting rid of any other attempts at this customization from your site, and simply replacing your existing functions.php code with the new functions.php I wrote for you here → https://gist.github.com/ggwicz/12006d4903f6092c82e0
If you do this and still get a white screen of death on your site, then there are two things I can think of: first, you could keep the code in place and then head to your site’s wp-config.php file and change this line of code:
define('WP_DEBUG', false);to this:
define('WP_DEBUG', true);That will display PHP errors on your site if any exist, which can help here.
Or, we can leave “Events” in place for now, and simply just remove all these customization attempts and wait for the next update – in the next plugin update, there is a new function that makes changing the label like this so easy!
Let me know if this re-worked functions.php helps!
Cheers,
George-
This reply was modified 10 years, 6 months ago by
George.
April 13, 2015 at 6:19 pm #955271James
ParticipantHi George,
Thanks for the rewritten code.
The code worked but only in the “backend” of the site, the frontend didn’t change at all.
I think I’ll wait for the calendar update. Save you worrying about putting more time into this.
I did mean to say early in the piece, that I really like the Event Calendar system and find it really flexible and does what I need it to do. I don’t think anyone would have any reason to complain about the support either, you do a great job, all in all.
Thanks for your assistance to date George, you have been really helpful.
Cheers,
James 🙂
April 14, 2015 at 7:29 am #955403George
ParticipantThank you for the kind words James! I’m really sorry this isn’t working for you – it worked well for me on my testing site on both the front-end and back-end, so I suspect your theme or another plugin are conflicting here in some way.
Regardless of that, stay tuned to the next update, because like I said, this will be much easier – just two simply filter calls and boom, the labels are updated everywhere on the site. It’s quite nice, actually!
If issues happen even with that method, after the update is released, we can dive deeper, but for now, based on your feedback here, I’ll go ahead and close up this ticket.
Thanks for your patience and the kind words James! Best of luck with your site in the meantime, and if any other issues or questions arise, come back and open a new ticket at any time!
Cheers,
George -
This reply was modified 10 years, 6 months ago by
-
AuthorPosts
- The topic ‘Changing the word "Events" on the front end only?’ is closed to new replies.
