By using Elementorforum.com’s services you agree to our Cookies Use and Data Transfer outside the EU.
We and our partners operate globally and use cookies, including for analytics, personalisation, ads and Newsletters.

  • Join the Best Unofficial Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor


    Join us!
elementor official
N

nevo

New Member
Hey!
I am using the Login widget and when someone inserts the wrong username or password it transfers him to the WordPress login page.
How can I do that it just shows a message?
Thanks
 
elementor official
G

gregdyer

New Member
If you're found a solution to this please let me know - I have the same issue.

Thanks,

Greg
 
elementor official
sms-design

sms-design

Member
This is a known issue in Elementor apparently but from the following github page code snippet by (TheDuvetman) you can add this code to your child themes function file. I have not personally tested this solution.

function redirect_login_page() {
$login_page = home_url( '/login/' );
$page_viewed = basename($_SERVER['REQUEST_URI']);

if( $page_viewed == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') {
wp_redirect($login_page);
exit;
}
}
add_action('init','redirect_login_page');

function login_failed() {
$login_page = home_url( '/login/' );
wp_redirect( $login_page . '?login=failed' );
exit;
}
add_action( 'wp_login_failed', 'login_failed' );


add_action( 'init', 'my_login_redirect' );

function my_login_redirect() {

$page_viewed1 = basename($_SERVER['REQUEST_URI']);
$my_account_page = home_url( '/my-account/' );
$my_login_page = home_url( '/login/' );

if ( is_user_logged_in() ) {
if ( $page_viewed1 == "login" ) {
wp_redirect($my_account_page);
exit();
}
}else{

if ( $page_viewed1 == "my-account" ) {
wp_redirect($my_login_page);
exit();
}

}

}


function verify_username_password( $user, $username, $password ) {
$login_page = home_url( '/login/' );
if( $username == "" || $password == "" ) {
wp_redirect( $login_page . "?login=empty" );
exit;
}
}
add_filter( 'authenticate', 'verify_username_password', 1, 3);

function logout_page() {
$login_page = home_url( '/login/' );
wp_redirect( $login_page . "?login=false" );
exit;
}
add_action('wp_logout','logout_page');


/**
* Logout redirect
*/

add_action('wp_logout','auto_redirect_after_logout');
function auto_redirect_after_logout(){
wp_redirect( 'domain.example/login' );
exit();
}
 
elementor official
G

gregdyer

New Member
Awesome - I'll give it a test and let you know!

Thanks for the reply - I appreciate it!
Greg
 
elementor official
Koni Kodes

Koni Kodes

Member
@gregdyer I would like to know if this works for you. I ended up using Clean Login and ColorLib Custom Logins. So far no issues, but we're not live yet.
 
elementor official
G

gregdyer

New Member
I'm migrating a site that currently protects a 'Members Only' page where existing members of a golf club can see internal information and member contact information. The general public will not be able to login but can see all the other information for events and golf, tennis, and swimming.

I can export all of the users from the old db...but want users to create a new password by 'failing' the login and resetting with a new password.

The code on the Github page redirects the users back in a loop but doesn't help if I want them to 'Reset/Create' a new password on a 'branded' page. Basically masking the WP logo and in the screen clips below.

1580582047199.png
1580582086068.png


I'll totally try the plugins if they'll help with the workaround.

Thanks !!
 
elementor official
Koni Kodes

Koni Kodes

Member
I hope they will help. I think the Clean is the one that controls the redirects....
 
elementor official
sms-design

sms-design

Member
Using the Emergency Reset Plugin will email all users (and admin) and you could also use the Expire Passwords for good measure.

And by styling your wp rest password email you can point users to the new login.

 
elementor official
G

gregdyer

New Member
I Like that SMS - Nice workflow for a solution!

I appreciate the time you have taken to help me and the community!

Best,

Greg
 
elementor official

Latest posts

Other Elementor Resources

elementor official
elementor official
Top