Page 1 of 1

How to change "display_name" to Username?

PostPosted: April 19th, 2011, 2:48 pm
by ProCody_Rookie_coding
Hey there,

I am looking for any way to edit the code on the file that makes the display name
point to the "first name" given by the user when they register on my s2member site.

I need to change the display name to the username, and I would also like to display some
information from a custom field, where the users info is displayed in the comment area
as well the new username instead of the first name.


My Goal:

When a user logs into my site, have their username displayed on there comments
not their fist name, along with information from a drop-down
"custom field" ( in this case the college the user goes to).

Much thanks! :D

-Cody

Re: How to change "display_name" to Username?

PostPosted: April 19th, 2011, 4:47 pm
by Cristián Lávaque
Hi Cody. :)

You will need to edit your theme templates where you want to change/add these things.

s2Member provides a way to use their profile data and is documented here WP Admin -> s2Member -> API / Scripting -> s2Member PHP/API Constants.

I hope that helps.

Re: How to change "display_name" to Username?

PostPosted: April 19th, 2011, 8:42 pm
by ProCody_Rookie_coding
Hey Cristián,

Thanks for the response!!

I understand what I need to do, and I have the code for the username the person
gives at registration:

S2MEMBER_CURRENT_USER_LOGIN
This will always be a (string) containing the current User's Username. Empty if not logged in.

<?php echo S2MEMBER_CURRENT_USER_LOGIN; ?>


--I'm pretty new to the wordpress world and I was hoping you could point me in the direction
of the theme templates i would need to edit? maybe where this code is to be placed exactly...
Sorry for the rookie quesiton. :oops:

-Cody

Re: How to change "display_name" to Username?

PostPosted: April 19th, 2011, 10:18 pm
by Cristián Lávaque
No problem. :)

Well, the template you need to edit will depend on where you want to make that change in your website. I suggest that you take a look at the files that are inside your theme's directory and you should be able to find the right place.

If that's something you don't feel you can do yet, I'd try getting a freelance developer help you customize it. viewforum.php?f=37