Archived topic
Customizing the "category" meta on single posts
3 replies · Started by ch1800 on February 13, 2021
Hello,
I'm trying to use a customization from another site here that allows to bring the category meta on top of posts and then customize its layout, but this CSS doesn't seem to work the same at this site.
I first use this snippet that bring the category on top and that works fine.
add_filter( 'generate_header_entry_meta_items', function( $items ) {
if ( is_single() ) {
$items = array(
'categories',
'date',
'author',
);
} return $items;
} );
But then, those 2 CSS snippets don't work with that site anymore:
/* plain text prefixes for posts meta */
.single .cat-links a:before {
content: 'Category:';
margin-right: 0.5ch;
}
.single .cat-links a:after {
content: ' -';
margin-right: 0.5ch;
}
I provide both links in information box.
Thanks!
Hi there,
you have some broken CSS - its missing a closing bracket see below:
/* line animation of all h2 */
h2:hover:after {
width: 50%; /* This will be the new width of your border when on hover */
} <---- missing this bracket
Ouch, many thanks David - overwritten this one when adding the new block...
Glad to be of help