[Resolved] Blog Posts Customization

Home Forums Support [Resolved] Blog Posts Customization

Home Forums Support Blog Posts Customization

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1407656
    Claire

    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,

    #1407715
    David
    Staff
    Customer Support

    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;
    } );
    #1407719
    Claire

    Hi,

    Place that code in the additional css?

    I did that but the code just come up as errors.

    #1407725
    David
    Staff
    Customer Support

    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

    #1407745
    Claire

    Thanks,

    That worked, but how can it be centered with vertical bars in between?

    > (centered)
    author | category | comments

    #1407990
    Leo
    Staff
    Customer Support

    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 );
    #1408032
    Claire

    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?

    https://www.athomebeauty.co/diy-home-scents/

    #1408070
    Leo
    Staff
    Customer Support

    Try this CSS:

    .entry-meta {
        text-align: center;
    }
    #1408211
    Claire

    Thank you.

    That worked.

    #1408213
    Leo
    Staff
    Customer Support

    No problem 🙂

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