Skip to content

Modify Post Meta Icons

The following snippet shows how you can modify the icons used for the post meta blocks. This snippet displays the default icons used so you can simply switch out the names for the theme icons you want to use instead.

View all theme icons.

add_filter( 'totaltheme/meta/block_icon', function( $icon, $block_name ) {
	switch ( $block_name ) {
		case 'date':
		case 'date-event':
		case 'date-modified':
			$icon = 'calendar-o';
			break;
		case 'estimated-read-time':
			$icon = 'clock-o';
			break;
		case 'author':
			$icon = 'user-o';
			break;
		case 'categories':
		case 'first-category':
			$icon = 'folder-o';
			break;
		case 'comments':
			$icon = 'comment-o';
			break;
	}
	return $icon;
}, 10, 2 );
All PHP snippets should be added via child theme's functions.php file or via a plugin.
We recommend Code Snippets (100% Free) or WPCode (sponsored)
Related Snippets
Back To Top