[Resolved] Gravatar Image is not Showing on Author Profile

Home Forums Support Gravatar Image is not Showing on Author Profile

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1162770
    Chandresh Bisht

    Hi,
    I am using the following CSS for showing Author box but the author profile picture is not showing.

    .author-box {
    	padding: 0 20px;
    	font-size: 14px;
    	background-color: #fff;
    	display: -webkit-box;
    	display: -ms-flexbox;
    	display: flex;
    }
    .author-box .avatar {
    	width: 250px;
    	height: auto;
    	border-radius: 100%;
    	margin-right: 30px;
    }
    p.author-title {
    	font-size: 18px;
    	margin-bottom: 0.1em;
    	font-weight: 600;
    }
    .author-description {
    	line-height: 1.6em
    }
    @media (max-width: 768px) {
    	.author-box {
    		padding-bottom: 0px;
    	}
    	.author-box .avatar {
    		margin-right: 10px;
    		width: 150px;
    	}
    	.author-box .avatar img {
    		max-width: 100px;
    	}
    }

    Gravatar Image is showing on comments but not showing on Author Box.

    You can check here at one of the posts of my site for Amazon Upcoming Sale

    Looking for quick reply.

    Thanks

    #1163038
    David
    Staff
    Customer Support

    Hi there,

    how is the Author Profile being added to the Site ?
    Are you using a plugin or code. If its code can you share it here.

    #1163122
    Chandresh Bisht

    It is updated through code.
    Added the following code on the element.

    <div class="author-box">
        <div class="avatar">
            <?php echo get_avatar( get_the_author_meta( ‘ID’ ), 250 ); ?>
        </div>
        <div class="author-info">
    		<p class="author-title" itemprop="author" itemscope itemtype="http://schema.org/Person">
    			<span itemprop="name"><?php printf( get_the_author_meta( 'display_name') );?></span>
    		</p>
            <div class="author-summary">
                <p class="author-description"><?php echo wp_kses( get_the_author_meta( 'description' ), null ); ?></p></div>
        </div>
    </div>
    #1163166
    David
    Staff
    Customer Support

    Its the pretty quote marks ‘ID’ in your code thats the problem.
    The line should read like so:

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

    #1163187
    Chandresh Bisht

    Working fine.
    Thanks a lot.

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