WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to display the user names by the reference of user id.

Is there any function like get_user_displaynme($userid)? (and one more Is there any shortcode to get group names?)

Thanks in Advance

share|improve this question
up vote 2 down vote accepted

You can use the very same get_userdata function of WordPress to code a specific function. Stick this in your functions.php:

function get_display_name($user_id) {
    if (!$user = get_userdata($user_id))
        return false;
    return $user->data->display_name;

So you can do something like:

$display_name = get_display_name($some_user_id);
echo $display_name;
share|improve this answer
Thanks Vinicius. – user1460692 Jul 25 '12 at 6:33

There is a nice native function called get_user_by


share|improve this answer
Please don't just add links, it's better to offer an explanation in your answer. – ialocin Nov 16 '13 at 15:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.