Archived topic
Blog Posts Customization
9 replies · Started by Claire on August 18, 2020
Hi,
How can I get my author, category, comments etc., on the top of my blog posts?
I'm in the Customize/Blog/Content section, but they don't all show on the top of my blog posts.
You can see my 'by Claire Bullerwell' is not centered and is by itself.
https://www.athomebeauty.co/derma-needling/
Here's an image to show you what I mean.

Thanks,
Hi there,
Try adding this PHP Snippet to place them in the Header Entry Meta:
add_filter( 'generate_header_entry_meta_items', function( $items ) {
if ( is_single() ) {
$items = array(
'author',
'categories',
'comments-link',
);
} return $items;
} );
Hi,
Place that code in the additional css?
I did that but the code just come up as errors.
Sorry that code is PHP - this link will help:
https://docs.generatepress.com/article/adding-php/
TLDR: Place it in your Child Themes functions.php or add it to the site using the Code Snippets plugin
Thanks,
That worked, but how can it be centered with vertical bars in between?
> (centered)
author | category | comments
I'm not seeing the meta currently but you can try this to add the vertical bar:
add_filter( 'generate_inside_post_meta_item_output', function( $output, $item ) {
if ( 'categories' === $item ) {
return ' | ';
}
if ( 'comments-link' === $item ) {
return ' | ';
}
return $output;
}, 50, 2 );
Thank you, and how can I center the meta too (it's on the left hand side at the moment)
Can you see the meta?
Try this CSS:
.entry-meta {
text-align: center;
}
Thank you.
That worked.
No problem :)