hi and thanks for reading i try to grab the authors slug in the backend.

get_the_author_meta( 'user_nicename' );

is empty. i tried to google this issue, but cant find any concrete info on how to handle the backend. any hints would be nice. i keep writing to meet the quality standards. sorry for spaming but this seems to be the only solution. call it spam, i call it anyoing, but i wont complain, cause otherwise, what stupid text would end up here, just to get a little help.

link|improve this question
feedback

2 Answers

Please read the codex on this function. Outside of the loop, your second arg must be a user ID. Inside the loop, WP grabs it from the post data.

get_the_author_meta('user_nicename', $userID);
link|improve this answer
ok. got it, thank you. was confused cause it worked in some other place (well, in the loop). – honk31 Dec 11 '11 at 12:46
feedback

to get, what i wanted, not just in the loop, but also in the backend, i wrote

function my_function( $id = 0 ) {
    $post = &get_post($id);
    $author = get_userdata($post->post_author);
    $user_url = $author->user_nicename;
}
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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