WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] the_author_meta not working

[Resolved] the_author_meta not working

  • Trying to insert an authors image … not working. Code:
    <img src="<?php echo get_option('home'); ?>/wp-content/images/authors/<?php the_author_meta('first_name'); ?>_<?php the_author_meta('last_name'); ?>.jpg" class="ImagesLeftAlign" alt="<?php the_author(); ?>">

    the_author is working … returns the author’s name
    the_author_meta(‘first_name’) returns nothing … it’s blank.

    I have tried get_the_author_meta as well.

    I have tried user_firstname and user_lastname also with both combinations.

    Suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)
  • wondering if I need to have data in author_meta table or something that isn’t in there?

    Yes that is the issue … first/last name field was blank for the author I was testing this on. Marked as resolved, left it up in case it might be helpful to others.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] the_author_meta not working’ is closed to new replies.
Skip to toolbar