Site logo

Archived topic

Blog Posts Customization

9 replies · Started by Claire on August 18, 2020

Viewing posts 1–10 of 10

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.

See this image here

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.

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 );

Try this CSS:

.entry-meta {
    text-align: center;
}

Thank you.

That worked.

No problem :)

This archived topic is closed to new replies.