Site logo

Archived topic

Avoid Large Layout Shifts Fix?

1 reply · Started by Thomas on April 27, 2021

Viewing posts 1–2 of 2

I'm working on my core web vitals and getting a layout shift error. Seems to be coming from the little tag icon. Anything I can do to fix this? Would have no problem replacing the tag and folder icons if there's an easy way to do that and just make them "tags" and "category" instead of little images ( if that fixes things?)

Thanks in advance!

<svg viewBox="0 0 512 512" aria-hidden="true" role="img" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1em" height="1em">

Hi there,

We can replace these icons by using this PHP filter to remove them.

add_filter( 'generate_inside_post_meta_item_output', function( $output, $item ){
	if ( $item === 'categories' || 'tags' ) {
		$output = '';
	}
}, 15, 2 );

And then add this CSS for thee "tags" and "category" label.

span.cat-links:before {
    content: "Category: ";
}
span.tags-links:before {
    content: "Tags: ";
}
This archived topic is closed to new replies.