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.

If I wanted to get a custom field of the current user I would use something like this.

<?php echo get_user_meta($user_info->ID,'address_line_2',true);?>

This time however I want the author so I tried multiple version of the following to no avail.

<?php 
$thisauthorID = get_the_author_ID();

echo get_the_author_meta($thisauthorID,'address',true)
        ;?>

Any ideas?

Marvellous

share|improve this question

1 Answer 1

up vote 2 down vote accepted

get_the_author_meta() != get_user_meta().
Change to:
echo get_the_author_meta('address', $thisauthorID);

share|improve this answer
    
Quite right, just got it myself. Thanks, –  Robin I Knight Feb 22 '11 at 17:10
    
humm - not sure i get the difference. get_the_author_meta() defaults to the current user, unless the second parameter is defined. Where as get_user_meta(id) means the user id must be passed in. Is that the main difference? –  emeraldjava Sep 6 '12 at 16:38

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.