Change username to first name (or full name) in header

I’m trying to change the appearance of the header so when a user is logged, he or she sees their username currently, but I’d rather they see their first or full name in that area, if they filled that out.

I went to HivePress/Settings/Users/Display to change to full name from the pulldown, but I still see the username in the header instead.

It is possible but requires overriding file /hivepress/templates/user/login/user-login-link.php via a child theme. If you’re familiar with the theme customization basics please check this tutorial Customizing Templates I HivePress Developer Docs - YouTube

Right. I know that already. That’s not the question.

The question is what do I change get_username to in order to display the full name?

Please try changing get_username() with get_full_name() if you already copied this template part to a child theme. The name fields are not guaranteed to be non-empty unless you added them to the registration form, you can also try using get_display_name() instead

Ah, that’s it. I was trying similar variations of that but it wasn’t working properly. Now it does, so thank you for that.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.