Support

Home Forums Event Espresso Premium Only Show First Initial in Last Name for Listattendees

Only Show First Initial in Last Name for Listattendees

Posted: March 12, 2014 at 8:31 am


Clair Mason

March 12, 2014 at 8:31 am

Hello everyone. I was wondering how I needed to edit the attendee_list.php or short codes.php so that the [listattendee] shortcode shows First Name, First Initial of Last Name, City/state.

Example:
Clair M. Norwalk, CT

Thank you


Tony

  • Support Staff

March 12, 2014 at 8:55 am

Hi Clair,

LISTATTENDEES currently ouputs Gravatar, First Name, Last Name, City/State.

So in effect it seems all you need to change is Last Name to only show the first letter. So if go to event-espresso/templates/ you’ll find attendee_list.php

Copy that file to wp-content/uploads/espresso/templates/

Then on line 91 you’ll find

<li class="attendee_details"> <span class="espresso_attendee"><?php echo $gravatar ?><?php echo stripslashes_deep($fname . ' ' . $lname) . $city_state .'</p>'; ?> </span>

Change that to:

<li class="attendee_details"> <span class="espresso_attendee"><?php echo $gravatar ?><?php echo stripslashes_deep($fname . ' ' . substr($lname, 0, 1)) . $city_state .'</p>'; ?> </span>

That should then only display the First letter of the Last Name.

Hope that helps.


Clair Mason

March 12, 2014 at 8:56 am

Exactly what I was looking for. Thank you so much Tony


Tony

  • Support Staff

March 12, 2014 at 9:27 am

No Problem 🙂

The support post ‘Only Show First Initial in Last Name for Listattendees’ 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