[Support request] Need help customizing author box

Home Forums Support Need help customizing author box

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #940023
    Johanna

    I added a hook to GP elements to add an author box:

    <div class="author-box">
    	<?php 
    	global $post;
    	$author_id = $post->post_author;
    	?>
    	<div class="avatar"><?php echo get_avatar( get_the_author_meta( $author_id ));?></div>
    <h5 class="author-title" itemprop="author" itemscope itemtype="http://schema.org/Person">
    	<span itemprop="name"><?php printf( get_the_author_meta( 'display_name') );?></span>
    </h5><div class="author-summary">
    		<p class="author-description"><?php echo wp_kses( get_the_author_meta( 'description' ), null ); ?></p>
    		<div class="author-links">
    			<a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" title="Read more">
    			...
    			</a>
    		</div>
    	</div>
    </div>

    Check my post and you will see that it works but I want to insert an author image to this code.

    Any idea how to do it?

    #940437
    David
    Staff
    Customer Support

    Hi there,

    try changing this line:

    <div class="avatar"><?php echo get_avatar( get_the_author_meta( $author_id ));?></div>

    to:

    <div class="avatar"><?php echo get_avatar( get_the_author_meta( 'ID' ));?></div>

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.