[Support request] Author Bio Box

Home Forums Support Author Bio Box

  • This topic has 3 replies, 2 voices, and was last updated 1 year ago by David.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1017759
    gedosan

    Hi guys

    Just implemented the author bio box via an Elements Hook and it’s showing up, but my gravatar pic isn’t getting pulled through.

    I’m using this PHP..is there something up with it?

    Thanks

    <?php
    global $post;
    $author_id = $post->post_author;
    ?>

    <?php echo get_avatar( get_the_author_meta( $author_id ));?>

    <h5 class=”author-title”><?php printf( get_the_author_meta( ‘display_name’) );?></h5>

    <p class=”author-description”><?php echo wp_kses( get_the_author_meta( ‘description’ ), null ); ?></p>

    #1017763
    David
    Staff
    Customer Support

    Hi there,

    change this line:

    <?php echo get_avatar( get_the_author_meta( $author_id ));?>

    to:

    <?php echo get_avatar( get_the_author_meta( 'ID' ));?>

    And you can then remove:

    $author_id = $post->post_author;

    #1017796
    gedosan

    Perfect thanks David

    #1017803
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.