Login with username or email address
10 Mai 2013, Posted by inAdding this snippet to the functions.php of your wordpress theme will let users login using an email address or a username. The second snippet will change the text on the login page from “username” to “username / email” but feel free to change the login text to anything you would like.
function login_with_email_address($username) { $user = get_user_by('email',$username); if(!empty($user->user_login)) $username = $user->user_login; return $username; } add_action('wp_authenticate','login_with_email_address'); function change_username_wps_text($text){ if(in_array($GLOBALS['pagenow'], array('wp-login.php'))){ if ($text == 'Username'){$text = 'Username / Email';} } return $text; } add_filter( 'gettext', 'change_username_wps_text' );