One way to achieve such effect would be to use wp_nav_menu_objects
hook.
function modify_home_in_nav_menu_objects( $items, $args ) {
foreach ( $items as $k => $object ) {
// you can also target given page using this if:
// if ( 'page' == $object->object && 2 == $object->object_id ) {
if ( 30 == $object->ID ) {
$object->title="<i class="fas fa-home"></i>";
}
}
return $items;
}
add_filter( 'wp_nav_menu_objects', 'modify_home_in_nav_menu_objects', 10, 2 );
PS. Should it really be fas
and not fa
in there?