Site logo

Archived topic

Add Author Image to Single Post Entry Meta

7 replies · Started by Navaneetha on February 12, 2019

Viewing posts 1–8 of 8

Hey there.
I don't want to make post date visible. I want to visible the Author image & author name only in the entry meta
Thanks

Hi there,

Try this function:

add_filter( 'generate_post_author_output', function( $output ) {
	$avatar = get_avatar( get_the_author_meta( 'ID' ) );

	if ( $avatar ) {
		return $avatar . $output;
	}

	return $output;
} );

Then this CSS:

.entry-meta .avatar {
    width: 25px;
    border-radius: 50%;
    vertical-align: middle;
    margin: 0 5px;
}

Let me know :)

Thank you so much.Its working

You're welcome :)

Hi Randy,

Can you open a new topic for your concern? So you could use the private information text field to provide the site details. Thank you.

This archived topic is closed to new replies.