Posted: February 5, 2016 at 1:08 pm
|
Hi, My client wants to change the text of category legend “Click to select a category” on the calendar to “Click to sort by site”. What code shall I change or add to my child theme to change this text and also make it bigger by 2 to 3 points? I can’t really show you the website it appears on as it’s a protected intranet. All EE4 plugins are up to date. Thank you, |
Hi Aurelien, You’d add the code to change this into your child theme. First, to change the text string, you add a translation function to your child theme’s functions.php file. A translation function can be used to change one or many strings. The string that you’re changing is https://eventespresso.com/wiki/how-to-change-wording-with-poedit/#custom-function Then, you add some CSS to your child theme’s style.css file. The selectors you’re going to target are So for example, something like this will change the font-size:
|
|
|
Hi Josh, Thank you for you reply. Here’s what I have for php but it doesn’t work: // This is an array of original strings // See if the current string is in the $strings array return $translated; add_filter( ‘gettext’, ‘mycustom_filter_gettext’, 10, 3 ); The CSS works though. What am I not doing properly with the php for it not to work? Also, your code states it’s for EE3 only whereas I have EE4 installed, does that matter? I’ve added this code to the functions.php of my child theme. Thank you, |
Hi there, The EE3 only reference is in relation to the custom files add-on (as that is only available for EE3), not the code on that page. When translating strings you need to match the original string exactly, you’ll notice in Josh’s reply he has:
In your code above you have:
So you can’t something like this:
The above code should then work fine. |
|
|
Thanks Tony, it now works correctly. Thanks a lot for your help! |
The support post ‘Change text of "Category legend"’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.