Site logo

Archived topic

how to add last updated and author name with gravator without plugin

1 reply · Started by Sanu Kumar on January 6, 2020

Viewing posts 1–2 of 2

how to add last updated and author name with gravatar without a plugin.

Currently, I am using this PHP:

add_filter( 'generate_post_author_output', function() {
return sprintf( ' <span class="byline">%1$s</span>',
sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author">%4$s<span class="author-name" itemprop="name">%3$s</span></span>',
esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ),
esc_html( get_the_author() ),
get_avatar( get_the_author_meta( 'ID' ) )
)
);
} );

add_filter( 'generate_header_entry_meta_items', function() {
return array(
'author',
'comments-link',
'date',
);
} );

add_filter( 'generate_footer_entry_meta_items', function( $items ) {
return array(
'date',
'categories',
);
} );

I have added this code in code snippets plugin...but I want to know is there any other method without plugin..If so, then could you tell me, because I don't want more plugin on my site.

Thanks

This archived topic is closed to new replies.