Support

Home Forums Event Espresso Premium Change "Add More Attendees" Text

Change "Add More Attendees" Text

Posted: February 11, 2013 at 8:04 pm


Jake Berman

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?


Josh

  • Support Staff

February 11, 2013 at 8:10 pm

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.


Jake Berman

February 11, 2013 at 8:27 pm

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.


Josh

  • Support Staff

February 11, 2013 at 8:59 pm

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.


Jake Berman

February 11, 2013 at 9:39 pm

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.


Dean

February 12, 2013 at 4:42 am

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

define('WPLANG', '');

and change it to

define('WPLANG', 'en_US');

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.


Jake Berman

February 12, 2013 at 10:29 am

Hi Dean,

I changed that when I uploaded the language files and still no luck.


Josh

  • Support Staff

February 12, 2013 at 10:36 am

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.

screenshot


Jake Berman

February 13, 2013 at 11:15 am

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?


Josh

  • Support Staff

February 13, 2013 at 12:03 pm

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.


Jake Berman

February 13, 2013 at 12:38 pm

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.


Jonathan Wilson

February 13, 2013 at 3:43 pm

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.


Jake Berman

February 14, 2013 at 12:20 pm

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.


Josh

  • Support Staff

February 14, 2013 at 2:37 pm

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:

'Add More Attendees? (click to toggle, limit ' => 'Your custom text here',


Jake Berman

February 15, 2013 at 12:32 pm

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)


Josh

  • Support Staff

February 15, 2013 at 3:38 pm

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:

'Add More Attendees? (click to toggle, limit ' => 'Additional Student (Click Here, limit ',


Jake Berman

February 26, 2013 at 6:07 am

Thanks Josh. Any way to take the limit and the limit number out all together?


Sidney Harrell

February 26, 2013 at 10:37 am

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 $html .= $i . ')</a>';
to

$html .= ')</a>';


Jake Berman

March 5, 2013 at 12:05 pm

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?


Chris Reynolds

  • Support Staff

March 5, 2013 at 2:49 pm

Have you tried changing the whole string? E.g. the text says: Add Additonal Attendee so you would change that to Add Additional Student.


Jake Berman

March 5, 2013 at 4:51 pm

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.


Josh

  • Support Staff

March 6, 2013 at 8:37 am

Hi Jake,

What’s the line of code that you used to change this? It should be something like this:

'Additional Attendee #' => 'Addtional Student #'


Jake Berman

March 8, 2013 at 12:38 pm

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.

Event Espresso