I'm looping through posts normally. I want to display the author ... simple <?php the_author(); ?> gives me "Patrick Daly". Nah, I just want the first name, so I use <?php the_author_meta( 'first_name' ); ?> and now I get .... "John"???

So the actual author of the post is "Patrick Daly" -- whose user account has all the correct information in it (nothing about John).

The loop seems to not be clearing "John's" meta and continues to reuse it. It does it's job when using the_author(); though.

Anything I need to be doing to clear the_author_meta();?

Here's what each function outputs on a single post (where the values in the database don't have John Doe):

           the_author_meta( 'ID' ); : 1
   the_author_meta( 'first_name' ); : John
    the_author_meta( 'last_name' ); : Doe
 the_author_meta( 'display_name' ); : Patrick Daly
                      the_author(); : Patrick Daly

This is a really if( have_posts() ) query, but I've tried wp_reset_postdata() and of course it didn't work.

  • 2
    Should work... post your actual (not so) working code please. – s_ha_dum Aug 22 '13 at 22:21
  • Seems odd. Have you tried explicitly declaring the user ID? the_author_meta( $field, $userID ); – vancoder Aug 22 '13 at 22:29
  • Have you tried disabling all plugins to see if the issue persists? – Pat J Aug 24 '13 at 19:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.