Archived topic
post info layout change
5 replies · Started by johnaps on April 2, 2020
Hello, i would like to make the posts that are shown on any archive or post look like this
https://ahrefs.com/blog/
More specifically, the category of the post to be shown above title and not bellow as is the default
And under the title to have author name with image first and the date to come second...
Is this possible??
Thank you in advance!!
Hi there,
this doc explains how to include the author avatar and display it inline with the Meta:
https://docs.generatepress.com/article/entry-meta-style/#example-1
To reposition the footer meta above the title try this:
add_action( 'after_setup_theme', 'tu_move_entry_meta' );
function tu_move_entry_meta() {
if ( !is_single() ) {
remove_action( 'generate_after_entry_content', 'generate_footer_meta' );
add_action( 'generate_before_entry_title', 'generate_footer_meta' );
}
}
Thank you very much David!!! Only problem left as you can see here http://thefinterestcom.kinsta.cloud/travel/
is that the date has been duplicated and been added in top of title also... can we remove it from there somehow? Also now how can i upload and set an image for the author?
Are you using this snippet?
add_filter( 'generate_footer_entry_meta_items', function( $items ) {
return array(
'date',
'categories',
);
} );
If so try this instead:
add_filter( 'generate_footer_entry_meta_items', function( $items ) {
return array(
'categories',
'post-navigation',
);
} );
As for author image, try this site:
https://en.gravatar.com/
Thank you :))) !!!
No problem :)