Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

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);
share|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
add comment

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;
}
share|improve this answer
add comment

Your Answer

 
discard

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.