[Resolved] Add Author Image to Single Post Entry Meta

Home Forums Support [Resolved] Add Author Image to Single Post Entry Meta

Home Forums Support Add Author Image to Single Post Entry Meta

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #808541
    Navaneetha

    Hai.
    I would like to add Author image to single post entry meta. This one https://docs.generatepress.com/article/entry-meta-style/ Not working for me. Can u please help me to add this.

    #808785
    Leo
    Staff
    Customer Support

    Hi there,

    Can you make sure Display Post date is activated?
    https://docs.generatepress.com/article/blog-content-layout/

    #808800
    Navaneetha

    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

    #808915
    Tom
    Lead Developer
    Lead Developer

    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 ๐Ÿ™‚

    #808930
    Navaneetha

    Thank you so much.Its working

    #809477
    Tom
    Lead Developer
    Lead Developer

    You’re welcome ๐Ÿ™‚

    #1625678
    Randy

    Hi tom, thanks for your great support.

    I wanna show this https://docs.generatepress.com/article/entry-meta-style/ only in single?

    I try disable meta author in blog archive by customizer but it didnt work.

    #1625702
    Elvin
    Staff
    Customer Support

    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.

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