Anonymous
Unregistered
Posted 8 years ago #
I want to turn the "author=#" field from the GET http call into an author name ... any ideas ?
In other words, I have:
http://mysite/index.php?author=2
and I want to change that "2" into "johnny boy", or whatever.
I need to do this outside the loop.
cheers,
e
get_userdata($author);
If that fails, try:
get_userdata($_GET['author']);
Then you can assign user/profile data this way:
$name = $profile->user_firstname . ' ' . $profile->user_lastname;
Or perhaps:
$name = $user->user_nickname;
Anonymous
Unregistered
Posted 8 years ago #
cool beans ...
that worked great.
Actually, this worked and then stopped working ... I hadn't tested with many different authors yet I guess.
Try this though ... so far it is working:
$myuser = $wpdb->get_row("SELECT * FROM $tableusers WHERE ID = '$author'");
$nick = stripslashes($myuser->user_nickname);
author needs to be passed as a GET variable, or somehow needs to be set. This is the author's ID, or number, I think.