[Resolved] Customization of entry meta

Home Forums Support [Resolved] Customization of entry meta

Home Forums Support Customization of entry meta

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1966622
    Ales

    Hi,

    I have currently this entry meta:

    But I would like to show it in this format:

    By $author_name on $date β€’ $categories

    By alesadmin on October 16, 2021 β€’ Uncategorized

    I think it should be possible via some PHP snippet but can’t figure it out.

    Thanks a lot!
    Ales

    #1966624
    Leo
    Staff
    Customer Support

    Hi there,

    This is the easiest and best solution:
    https://docs.generatepress.com/article/block-element-post-meta-template/

    No coding needed πŸ™‚

    #1971268
    Ales

    Hi Leo!

    Thanks, but I would like to keep it modified via code. It also has a better schema.

    I currently have this code:

    add_filter( 'generate_header_entry_meta_items', function( $items ) {
        return array(
            'date',
    		'author',
            'categories',
        );
    } );
    
    add_filter( 'generate_footer_entry_meta_items', function( $items ) {
        return array_diff( $items, [ 'categories' ] );
    } );

    And it works okay, now it looks like this:

    There is only one thing. Is there some way how to add that “folder” icon before the category? I have that icon on my other sites, not sure why it’s not here. It looks like this:

    Thanks a lot!

    EDIT:

    I used this CSS:

    .entry-header .gp-icon {
        display: inline-block;
    }
    
    .cat-links { 
    	padding-left: 5px;
    }

    Is that okay solution?

    #1971375
    Elvin
    Staff
    Customer Support

    Hi Ales,

    The icon is actually still there but is hidden by default for .entry-header with this CSS for post meta before the content.

    .entry-header .gp-icon, .posted-on .updated {
        display: none;
    }

    That CSS solution you’ve provided is okay. That’s actually the way to go because we only need to override the one hiding it. πŸ™‚

    A wise man once said:
    "Have you cleared your cache?"

    #1973176
    Ales

    Perfect, thanks a lot, Elvin!

    Marking this topic as resolved now.

    #1974052
    Elvin
    Staff
    Customer Support

    Nice one. No problem. πŸ˜€

    A wise man once said:
    "Have you cleared your cache?"

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