When trying to login if already logged in, form just shakes – error message remains empty


I am already logged in (with role administrator). If I try to login again with wp-login.php the form just shakes – the error message above the form remains empty. Following a suggestion on this forum I added the following code to my theme’s function.php – it works:
/* Create error message for new login attempt if user is already logged in */

function login_error_message($error){
    //create error message for already logged in
    $error = "You are already logged in";
    return $error;
OldStick 2 years 2020-09-26T01:10:32-05:00 0 Answers 20 views 0

Leave an answer