displaying firstname_lastinitial

For security we have our student accounts set up as follows:

Firstname = full first name

Lastname = first initial of last name

but the username is all/part of their last name and first initial.

I’d like their content(posts, comments,etc) to display their first name/last initial and have selected for each student this format in "Display Name Publicly As"

But when they make a comment their comment is stamped with their username – not the "Display Name Publicly As" choice. Looks like I can change this in comments.php

<p class="unstyled">Logged in as /wp-admin/profile.php"><?php echo $user_identity; ?>. /wp-login.php?action=logout" title="<?php _e(‘Log out of this account’:wink: ?>">Logout »</p>

Thinking I need to change $user_identity and have tried $nickname and others – what would this need to be to use first name/last initial?

For Posts – I think the edit would be in single.php?