WordPress.org

Support

Support » How-To and Troubleshooting » Is there a better way to show UID in comment loop?

Is there a better way to show UID in comment loop?

  • Here’s what I’m using right now:

    ‘ (UID#<?php $user = get_userdata($comment->user_id); echo $user->ID; ‘?>)

    but that code is slowing my site down a bit. is there a smarter way to show the user ids in the comments?

    here’s an example of what I’m doing:

    Fetching Smile

Viewing 2 replies - 1 through 2 (of 2 total)
  • Isn’t..

    $comment->user_id

    the same value as..

    $user->ID;

    Looks to me like you’re calling get_usermeta to get data you already have…

    Pretty sure you’ll get the same result from..

    (UID#<?php echo $comment->user_id; ?>)

    sweet, that works, thanks a ton!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Is there a better way to show UID in comment loop?’ is closed to new replies.