Template:Username

From Stampy's Wiki

Returns blank if logged out, else gives the name of the current user, first checking the realname user preference, then the displaytitle of the userpage, then falls back on username.

{{Username}}