By stevenandwes on
Hi,
I'm trying to override the theme_username function in order to display a users first and last name instead of their username. I have two custom fields on the Profile Information page called "profile_first" and "profile_last" which requires all users to enter a first and last name. Pretty much other than that all I've done is copied the function from theme.inc into my template.php file and renamed the function phptheme_username.
Now I'm stuck here. Any further help would be awesome.
Thanks
-Steve
Comments
_
You may wish to checkout the http://drupal.org/project/realname module which does exactly this. I use it and it works great.
RealName
Yeah my boss wants me to hard code it. I suggested that as well.
_
Then use the code. ;-)
What do you mean?
What do you mean?
_
The module does exactly what you're asking for-- take the _username code from there.
...
So I copied the _username code from the realname module and pasted it into my template.php file in place of the old _username code, and nothing happened... any help would be awesome.
_
Sorry-- I didn't mean to imply it was that simple or you should grab the whole function-- I meant to look to that code for what you needed to add to your theme_username override.
Something like the following should do it: