Site logo

Archived topic

Customization of entry meta

5 replies · Started by Ales on October 17, 2021

Viewing posts 1–6 of 6

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

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?

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. :)

Perfect, thanks a lot, Elvin!

Marking this topic as resolved now.

Nice one. No problem. :D

This archived topic is closed to new replies.