Posted: February 11, 2013 at 8:04 pm
|
Hi folks, I’m using the latest version of Event Espresson and I’m not able to change the “Add More Attendees?” text. I’m looking in the event_espresso_additional_attendees function in main.php, but I can’t find where to change it. Has this changed since the update? |
Hi Jake, We really don’t recommend modifying core functions in order to change text strings. Instead, we recommend changing them via a language file or use the gettext filter. Here’s a great little tutorial that shows you how change text strings that with a filter: http://www.viper007bond.com/2011/07/13/changing-core-wordpress-strings/ You can add the function from that tutorial to your WordPress theme’s functions.php or create your own little functionality plugin. |
|
|
Thank you. I edited the US english.po file but when I uploaded it to the language directory there are no other files there. Also, English is the selected language in the admin panel but the changes don’t appear. |
Hi Jake, You should be uploading the .mo file that PoEdit generates, and it’s okay if there aren’t any files there. There shouldn’t be any in /wp-content/uploads/espresso/languages or in the core plugin because they’ve all been removed. |
|
|
Poedit only generates a .po file for me. I’m using MacOX and there is no way to export to .mo. It just saves the .po. |
|
Hi, Though I cant answer your mac related question (Windows user here) regarding the language file not displaying, it could be because the wp-config needs changing. In that file is you find the section that says
and change it to
and save it it should kick in your changes. Remember to back that file up before changing it as it is a very important file to your site. |
|
Hi Dean, I changed that when I uploaded the language files and still no luck. |
Hi Jake, PoEdit will generate a .mo file when you save as. For example, if you save the .po file to your desktop, there will be a .mo file right along side of it. |
|
|
Thanks Josh. I had both files on the desktop to start with so I thought it wasn’t producing anything. I uploaded them and made sure my WP config is set to en_US and still no dice. Is there a language setting in the Event Espresso admin panel that needs to be set? |
Hi Jake, There isn’t a language setting in Event Espresso. It’s all handled in the wp-config.php. Are you comfortable with copying and pasting code into your theme’s functions.php file? This tutorial would likely be a simpler solution for changing a few text strings. |
|
|
I can’t make heads or tails from that tutorial unfortunately. That was my first option. It’s only 1 string that I want to change. |
Hi Jake, Did you copy the language files to the wp-content/uploads/espresso/languages directory? You might need to clear your browser cache also. |
|
|
Hi Johnathan, Yes they were uploaded to both that directory and the other languages directory in plugins/event-espresso/languages. Cleared the cache and it still doesn’t update. |
Hi Jake, You’ll want to make sure that you upload the .mo file that you end up with after you edit and save the .po file in Poedit, not the one you download from github. The gettext filter option is pretty straight forward. You copy and paste the code block from the tutorial into your theme’s functions.php file. Then on the line where it says “//Add some more strings here” you replace it with:
|
|
|
Ok, working now. The only issue is that I get this strange “8)” after my new string. Don’t know where it’s coming from. So it displays as: Additional Student (Click Here)8) |
Hi Jake, That’s probably the attendee limit if I were to take a guess. Do you see where the original text string ends with the word “limit”? After the word limit, the attendee limit is displayed. That’s supposed to be there. So you might try this:
|
|
|
Thanks Josh. Any way to take the limit and the limit number out all together? |
|
I think you would have to copy the function event_espresso_additional_attendees from main.php into the custom files add-on, then modify the line that is currently at line 282 of main.php from
|
|
Works perfectly. Now the only issue I have is that the phrase “Additional Attendee” appears under what I changed to “Additional Student”. I’ve tried changing this in my functions file, but no luck. Any thoughts? |
Have you tried changing the whole string? E.g. the text says: |
|
|
Yes. It changes the full string on the page, but after you click to add another student beneath it, “Additional Attendee #1” appears beneath it. |
Hi Jake, What’s the line of code that you used to change this? It should be something like this:
|
|
|
Ah, I wasn’t putting in the full string. That’s the problem. I was just putting in ‘Additional Attendee’ instead of ‘Additional Attendee #’. Worked perfectly. Thanks so much! |
The support post ‘Change "Add More Attendees" Text’ 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.